feat(security): #328 delete old sessions for change and forgot password
This commit was merged in pull request #335.
This commit is contained in:
@@ -61,7 +61,9 @@ func CrossSiteRequestForgery(auth service.Auth) func(http.Handler) http.Handler
|
||||
}
|
||||
}
|
||||
|
||||
if session == nil && (strings.Contains(r.RequestURI, "/auth/signup") || strings.Contains(r.RequestURI, "/auth/signin")) {
|
||||
// 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)
|
||||
|
||||
Reference in New Issue
Block a user