mirror of
https://github.com/casdoor/casdoor.git
synced 2025-07-03 12:30:19 +08:00
feat: fix Beego session delete concurrent issue (#3103)
This commit is contained in:
@ -21,6 +21,7 @@ import (
|
||||
"strings"
|
||||
|
||||
"github.com/beego/beego/context"
|
||||
|
||||
"github.com/casdoor/casdoor/conf"
|
||||
"github.com/casdoor/casdoor/i18n"
|
||||
"github.com/casdoor/casdoor/object"
|
||||
@ -125,7 +126,7 @@ func setSessionUser(ctx *context.Context, user string) {
|
||||
}
|
||||
|
||||
// https://github.com/beego/beego/issues/3445#issuecomment-455411915
|
||||
ctx.Input.CruSession.SessionRelease(ctx.ResponseWriter)
|
||||
ctx.Input.CruSession.SessionReleaseIfPresent(ctx.ResponseWriter)
|
||||
}
|
||||
|
||||
func setSessionExpire(ctx *context.Context, ExpireTime int64) {
|
||||
@ -134,7 +135,7 @@ func setSessionExpire(ctx *context.Context, ExpireTime int64) {
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
ctx.Input.CruSession.SessionRelease(ctx.ResponseWriter)
|
||||
ctx.Input.CruSession.SessionReleaseIfPresent(ctx.ResponseWriter)
|
||||
}
|
||||
|
||||
func setSessionOidc(ctx *context.Context, scope string, aud string) {
|
||||
@ -146,7 +147,7 @@ func setSessionOidc(ctx *context.Context, scope string, aud string) {
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
ctx.Input.CruSession.SessionRelease(ctx.ResponseWriter)
|
||||
ctx.Input.CruSession.SessionReleaseIfPresent(ctx.ResponseWriter)
|
||||
}
|
||||
|
||||
func parseBearerToken(ctx *context.Context) string {
|
||||
|
Reference in New Issue
Block a user