chore(auth): #331 add session test
All checks were successful
Build Docker Image / Build-Docker-Image (push) Successful in 44s

This commit is contained in:
2024-12-22 22:14:55 +01:00
parent ea653f0087
commit 144eea3cff
7 changed files with 73 additions and 20 deletions

View File

@@ -62,15 +62,6 @@ func CrossSiteRequestForgery(auth service.Auth) func(http.Handler) http.Handler
}
}
// Always sign in anonymous
// This way, there is no way to forget creating a csrf token
if session == nil {
session, _ = auth.SignInAnonymous()
cookie := CreateSessionCookie(session.Id)
http.SetCookie(w, &cookie)
}
responseWriter := newCsrfResponseWriter(w, auth, session)
next.ServeHTTP(responseWriter, r)
})