From e7230700e03ef317358f5d734c692633e00a1895 Mon Sep 17 00:00:00 2001 From: Yang Luo Date: Wed, 7 Aug 2024 16:51:54 +0800 Subject: [PATCH] feat: Revert "feat: fix Beego session delete concurrent issue" (#3105) This reverts commit f21aa9c0d24399e79016144e7f580107316ff810. --- go.mod | 2 +- go.sum | 4 ++-- routers/base.go | 7 +++---- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/go.mod b/go.mod index cfb6d93e..c344a508 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,7 @@ require ( github.com/Masterminds/squirrel v1.5.3 github.com/alexedwards/argon2id v0.0.0-20211130144151-3585854a6387 github.com/aws/aws-sdk-go v1.45.5 - github.com/beego/beego v1.12.13 + github.com/beego/beego v1.12.12 github.com/beevik/etree v1.1.0 github.com/casbin/casbin/v2 v2.77.2 github.com/casdoor/go-sms-sender v0.24.0 diff --git a/go.sum b/go.sum index 5c4f7fdd..40a3cb1b 100644 --- a/go.sum +++ b/go.sum @@ -1052,8 +1052,8 @@ github.com/baidubce/bce-sdk-go v0.9.156 h1:f++WfptxGmSp5acsjl4kUxHpWDDccoFqkIrQK github.com/baidubce/bce-sdk-go v0.9.156/go.mod h1:zbYJMQwE4IZuyrJiFO8tO8NbtYiKTFTbwh4eIsqjVdg= github.com/baiyubin/aliyun-sts-go-sdk v0.0.0-20180326062324-cfa1a18b161f h1:ZNv7On9kyUzm7fvRZumSyy/IUiSC7AzL0I1jKKtwooA= github.com/baiyubin/aliyun-sts-go-sdk v0.0.0-20180326062324-cfa1a18b161f/go.mod h1:AuiFmCCPBSrqvVMvuqFuk0qogytodnVFVSN5CeJB8Gc= -github.com/beego/beego v1.12.13 h1:g39O1LGLTiPejWVqQKK/TFGrroW9BCZQz6/pf4S8IRM= -github.com/beego/beego v1.12.13/go.mod h1:QURFL1HldOcCZAxnc1cZ7wrplsYR5dKPHFjmk6WkLAs= +github.com/beego/beego v1.12.12 h1:ARY1sNVSS23N0mEQIhSqRDTyyDlx95JY0V3GogBbZbQ= +github.com/beego/beego v1.12.12/go.mod h1:QURFL1HldOcCZAxnc1cZ7wrplsYR5dKPHFjmk6WkLAs= github.com/beego/goyaml2 v0.0.0-20130207012346-5545475820dd/go.mod h1:1b+Y/CofkYwXMUU0OhQqGvsY2Bvgr4j6jfT699wyZKQ= github.com/beego/x2j v0.0.0-20131220205130-a0352aadc542/go.mod h1:kSeGC/p1AbBiEp5kat81+DSQrZenVBZXklMLaELspWU= github.com/beevik/etree v1.1.0 h1:T0xke/WvNtMoCqgzPhkX2r4rjY3GDZFi+FjpRZY2Jbs= diff --git a/routers/base.go b/routers/base.go index 4ec6082c..82498afc 100644 --- a/routers/base.go +++ b/routers/base.go @@ -21,7 +21,6 @@ import ( "strings" "github.com/beego/beego/context" - "github.com/casdoor/casdoor/conf" "github.com/casdoor/casdoor/i18n" "github.com/casdoor/casdoor/object" @@ -126,7 +125,7 @@ func setSessionUser(ctx *context.Context, user string) { } // https://github.com/beego/beego/issues/3445#issuecomment-455411915 - ctx.Input.CruSession.SessionReleaseIfPresent(ctx.ResponseWriter) + ctx.Input.CruSession.SessionRelease(ctx.ResponseWriter) } func setSessionExpire(ctx *context.Context, ExpireTime int64) { @@ -135,7 +134,7 @@ func setSessionExpire(ctx *context.Context, ExpireTime int64) { if err != nil { panic(err) } - ctx.Input.CruSession.SessionReleaseIfPresent(ctx.ResponseWriter) + ctx.Input.CruSession.SessionRelease(ctx.ResponseWriter) } func setSessionOidc(ctx *context.Context, scope string, aud string) { @@ -147,7 +146,7 @@ func setSessionOidc(ctx *context.Context, scope string, aud string) { if err != nil { panic(err) } - ctx.Input.CruSession.SessionReleaseIfPresent(ctx.ResponseWriter) + ctx.Input.CruSession.SessionRelease(ctx.ResponseWriter) } func parseBearerToken(ctx *context.Context) string {