|
|
@@ -121,7 +121,6 @@ func checkAutoLogin(ctx *context.Context) bool { |
|
|
|
ctx.ServerError("AutoSignIn", err) |
|
|
|
return true |
|
|
|
} |
|
|
|
log.Info("here1...") |
|
|
|
redirectTo := ctx.Query("redirect_to") |
|
|
|
if len(redirectTo) > 0 { |
|
|
|
ctx.SetCookie("redirect_to", redirectTo, 0, setting.AppSubURL, "", setting.SessionConfig.Secure, true) |
|
|
@@ -130,15 +129,12 @@ func checkAutoLogin(ctx *context.Context) bool { |
|
|
|
} |
|
|
|
|
|
|
|
if isSucceed { |
|
|
|
log.Info("here2...") |
|
|
|
isCourse := ctx.QueryBool("course") |
|
|
|
|
|
|
|
ctx.SetCookie("redirect_to", "", -1, setting.AppSubURL, "", setting.SessionConfig.Secure, true) |
|
|
|
if redirectTo == "" && isCourse { |
|
|
|
ctx.SetCookie("redirect_to", "", -1, setting.AppSubURL, "", setting.SessionConfig.Secure, true) |
|
|
|
redirectToCourse := setting.AppSubURL + "/" + setting.Course.OrgName |
|
|
|
ctx.RedirectToFirst(redirectToCourse) |
|
|
|
} else { |
|
|
|
log.Info("here3...") |
|
|
|
ctx.RedirectToFirst(redirectTo, setting.AppSubURL+string(setting.LandingPageURL)) |
|
|
|
} |
|
|
|
return true |
|
|
@@ -155,10 +151,8 @@ func getActivityTpl() string { |
|
|
|
// SignIn render sign in page |
|
|
|
func SignIn(ctx *context.Context) { |
|
|
|
ctx.Data["Title"] = ctx.Tr("sign_in") |
|
|
|
log.Info("sign 11111111.........") |
|
|
|
// Check auto-login. |
|
|
|
if checkAutoLogin(ctx) { |
|
|
|
log.Info("sign 22222.........") |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|