summaryrefslogtreecommitdiffstats
path: root/routers
diff options
context:
space:
mode:
authorJack Hay <jack@allspice.io>2023-08-31 12:26:13 -0400
committerGitHub <noreply@github.com>2023-08-31 16:26:13 +0000
commitc0ab7070e56f1de390d2e7d6a95083137041a572 (patch)
tree8c96429af9c281db82022f61564fa5c7760ddd54 /routers
parent3cae50e841bf1551d82fe9ae3fe5c88627029c24 (diff)
downloadgitea-c0ab7070e56f1de390d2e7d6a95083137041a572.tar.gz
gitea-c0ab7070e56f1de390d2e7d6a95083137041a572.zip
Update team invitation email link (#26550)
Co-authored-by: Kyle D <kdumontnu@gmail.com> Co-authored-by: Jonathan Tran <jonnytran@gmail.com>
Diffstat (limited to 'routers')
-rw-r--r--routers/web/auth/auth.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/routers/web/auth/auth.go b/routers/web/auth/auth.go
index 3bf133f562..c20a45ebc9 100644
--- a/routers/web/auth/auth.go
+++ b/routers/web/auth/auth.go
@@ -398,6 +398,11 @@ func SignUp(ctx *context.Context) {
// Show Disabled Registration message if DisableRegistration or AllowOnlyExternalRegistration options are true
ctx.Data["DisableRegistration"] = setting.Service.DisableRegistration || setting.Service.AllowOnlyExternalRegistration
+ redirectTo := ctx.FormString("redirect_to")
+ if len(redirectTo) > 0 {
+ middleware.SetRedirectToCookie(ctx.Resp, redirectTo)
+ }
+
ctx.HTML(http.StatusOK, tplSignUp)
}
@@ -729,6 +734,12 @@ func handleAccountActivation(ctx *context.Context, user *user_model.User) {
}
ctx.Flash.Success(ctx.Tr("auth.account_activated"))
+ if redirectTo := ctx.GetSiteCookie("redirect_to"); len(redirectTo) > 0 {
+ middleware.DeleteRedirectToCookie(ctx.Resp)
+ ctx.RedirectToFirst(redirectTo)
+ return
+ }
+
ctx.Redirect(setting.AppSubURL + "/")
}