feat(security): #286 use csrf token for delete request
Some checks are pending
Build Docker Image / Build-Docker-Image (push) Waiting to run

This commit is contained in:
2024-12-11 15:47:29 +01:00
parent 8cf2210aaf
commit 3c1b346c95
4 changed files with 79 additions and 82 deletions

View File

@@ -86,16 +86,7 @@ func (handler AuthImpl) handleSignIn() http.HandlerFunc {
return nil, err
}
cookie := http.Cookie{
Name: "id",
Value: session.Id,
MaxAge: 60 * 60 * 8, // 8 hours
Secure: true,
HttpOnly: true,
SameSite: http.SameSiteStrictMode,
Path: "/",
}
cookie := middleware.CreateSessionCookie(session.Id)
http.SetCookie(w, &cookie)
return session.User, nil