chore: fix CSRF (#876)

This commit is contained in:
boojack
2022-12-30 00:17:19 +08:00
committed by GitHub
parent 64e5c343c5
commit c9bb2b785d
2 changed files with 5 additions and 0 deletions

View File

@@ -27,6 +27,7 @@ func setUserSession(ctx echo.Context, user *api.User) error {
Path: "/",
MaxAge: 3600 * 24 * 30,
HttpOnly: true,
SameSite: http.SameSiteStrictMode,
}
sess.Values[userIDContextKey] = user.ID
err := sess.Save(ctx.Request(), ctx.Response())