aboutsummaryrefslogtreecommitdiff
path: root/lib/api/api.go
diff options
context:
space:
mode:
Diffstat (limited to 'lib/api/api.go')
-rw-r--r--lib/api/api.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/api/api.go b/lib/api/api.go
index 5a4ee76a7..21f41f6f4 100644
--- a/lib/api/api.go
+++ b/lib/api/api.go
@@ -368,8 +368,8 @@ func (s *service) Serve(ctx context.Context) error {
// Wrap everything in basic auth, if user/password is set.
if guiCfg.IsAuthEnabled() {
- sessionCookieName := "sessionid-" + s.id.Short().String()
- authMW := newBasicAuthAndSessionMiddleware(sessionCookieName, s.id.Short().String(), guiCfg, s.cfg.LDAP(), handler, s.evLogger, s.miscDB)
+ tokenCookieManager := newTokenCookieManager(s.id.Short().String(), guiCfg, s.evLogger, s.miscDB)
+ authMW := newBasicAuthAndSessionMiddleware(tokenCookieManager, guiCfg, s.cfg.LDAP(), handler, s.evLogger)
handler = authMW
restMux.Handler(http.MethodPost, "/rest/noauth/auth/password", http.HandlerFunc(authMW.passwordAuthHandler))