Browse Source

提交代码

tags/v1.22.1.4^2
ychao_1983 4 years ago
parent
commit
2be45b1f52
1 changed files with 7 additions and 0 deletions
  1. +7
    -0
      routers/user/auth.go

+ 7
- 0
routers/user/auth.go View File

@@ -143,6 +143,7 @@ func SignIn(ctx *context.Context) {
ctx.Data["Title"] = ctx.Tr("sign_in")
ctx.Data["SignInLink"] = setting.AppSubURL + "/user/login"
ctx.Data["PageIsSignIn"] = true
ctx.Data["IsCourse"] = ctx.QueryBool("course")
ctx.Data["PageIsLogin"] = true
ctx.Data["EnableSSPI"] = models.IsSSPIEnabled()
ctx.Data["EnableCloudBrain"] = true
@@ -565,6 +566,12 @@ func handleSignInFull(ctx *context.Context, u *models.User, remember bool, obeyR
return setting.AppSubURL + "/dashboard"
}

isCourse := ctx.QueryBool("course")
if isCourse {
redirectToCourse := setting.AppSubURL + "/" + setting.Course.OrgName
ctx.RedirectToFirst(redirectToCourse)
return redirectToCourse
}
if redirectTo := ctx.GetCookie("redirect_to"); len(redirectTo) > 0 && !util.IsExternalURL(redirectTo) {
ctx.SetCookie("redirect_to", "", -1, setting.AppSubURL, "", setting.SessionConfig.Secure, true)
if obeyRedirect {


Loading…
Cancel
Save