diff --git a/go.mod b/go.mod index 187d7e92..fc0da431 100644 --- a/go.mod +++ b/go.mod @@ -27,6 +27,7 @@ require ( require ( cloud.google.com/go/compute v1.20.1 // indirect cloud.google.com/go/compute/metadata v0.2.3 // indirect + github.com/474420502/execute v0.2.2 // indirect github.com/DataDog/zstd v1.4.5 // indirect github.com/HdrHistogram/hdrhistogram-go v1.1.2 // indirect github.com/VictoriaMetrics/metrics v1.18.1 // indirect diff --git a/go.sum b/go.sum index 815b0b69..e1341003 100644 --- a/go.sum +++ b/go.sum @@ -35,6 +35,8 @@ cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohl cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= +github.com/474420502/execute v0.2.2 h1:Hzzb/HFa/urRvi3xWe+p/DnJgRyxXFVyEBEXbbITy/E= +github.com/474420502/execute v0.2.2/go.mod h1:wkKeKBIXYp7T844eU1YS2nPvFj8lra4VRcQYnWyXej4= github.com/474420502/passer v0.0.1 h1:ZWnt7hpFzsYDV7LHSEyLvLUvW5mRxrnDmgFdIl17q3w= github.com/474420502/passer v0.0.1/go.mod h1:MmnnrF9d51sPkFzdRq2pQtxQKqyjburVM1LjMbOCezE= github.com/474420502/random v0.4.1 h1:HUUyLXRWMijVb7CJoEC16f0aFQOW25Lkr80Mut6PoKU= diff --git a/server/auth/internal/logic/useremailconfirmationlogic.go b/server/auth/internal/logic/useremailconfirmationlogic.go index 3f6b9e51..351bdc5b 100644 --- a/server/auth/internal/logic/useremailconfirmationlogic.go +++ b/server/auth/internal/logic/useremailconfirmationlogic.go @@ -100,9 +100,10 @@ func (l *UserEmailConfirmationLogic) UserEmailConfirmation(req *types.RequestEma switch token.OperateType { case auth.OpTypeRegister: - if time.Since(token.CreateAt) >= 24*time.Hour { - return resp.SetStatus(basic.CodeOAuthConfirmationTimeoutErr) + if time.Since(token.CreateAt) > 30*time.Minute { + return resp.SetStatusWithMessage(basic.CodeOAuthConfirmationTimeoutErr, "Verification links expire after 30 minute.") } + logx.Info(token.Platform) switch token.Platform { case string(auth.PLATFORM_GOOGLE): @@ -110,7 +111,7 @@ func (l *UserEmailConfirmationLogic) UserEmailConfirmation(req *types.RequestEma user, err := l.svcCtx.AllModels.FsUser.RegisterByGoogleOAuth(l.ctx, token) if err != nil { logx.Error(err, token.TraceId) - return resp.SetStatus(basic.CodeDbSqlErr) + return resp.SetStatus(basic.CodeDbSqlErr, err.Error()) } err = FinishRegister(l.svcCtx, user, token) @@ -148,39 +149,44 @@ func (l *UserEmailConfirmationLogic) AfterLogic(w http.ResponseWriter, r *http.R successHtml := ` - 注册成功 + Registration Successful + + + -

恭喜!您的注册成功。

-

感谢您在我们网站进行注册。您的账号已经激活。

+

Congratulations! Your registration is successful.

-

您现在可以使用您的邮箱地址和密码登录我们的网站,享受完整的服务和功能。

+

Thank you for registering on our website. Your account has been activated.

-

再次感谢您的信任和支持。如果您有任何问题,请随时联系我们。

+

You can now login using your email address and password to enjoy full services and features on our website.

+ +

Thanks again for your trust and support. If you have any questions, please feel free to contact us.

+ +

We wish you a pleasant experience!

-

祝您使用愉快!

` w.Write([]byte(successHtml)) @@ -191,7 +197,7 @@ func (l *UserEmailConfirmationLogic) AfterLogic(w http.ResponseWriter, r *http.R - 注册失败 + Failed to register