|
|
|
@@ -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 { |
|
|
|
|