Change endpoints variable to endpoint

This commit is contained in:
some 2024-10-09 11:57:42 -04:00
parent 7a8eaeab05
commit b0f51d88c7
Signed by: some
GPG Key ID: 65D0589220B9BFC8

View File

@ -23,18 +23,18 @@ type Router struct {
}
func NewRouter(r *router.Router, logger log.Logger, endpointOverride ...Endpoint) (ro *Router) {
var endpoints Endpoint
var endpoint Endpoint
if r == nil {
r = router.NewRouter(nil, nil)
}
if len(endpointOverride) == 1 {
endpoints = endpointOverride[0]
endpoint = endpointOverride[0]
} else {
endpoints = endpointDefault
endpoint = endpointDefault
}
r.AddRequiredRoutes([]string{
endpoints.CallbackEndpoint,
endpoints.TokenEndpoint,
endpoint.CallbackEndpoint,
endpoint.TokenEndpoint,
})
if logger == nil {
logger = log.NewPlainLogger()
@ -42,7 +42,7 @@ func NewRouter(r *router.Router, logger log.Logger, endpointOverride ...Endpoint
return &Router{
Router: r,
Logger: logger,
Endpoint: endpoints,
Endpoint: endpoint,
}
}