modules/midlleware: little auth code fix

release/v1.15
Unknwon 2015-01-30 20:30:07 -05:00
parent ee6786216a
commit d8394bb2e0
1 changed files with 2 additions and 1 deletions

View File

@ -54,7 +54,8 @@ func Toggle(options *ToggleOptions) macaron.Handler {
if strings.HasSuffix(ctx.Req.RequestURI, "watch") { if strings.HasSuffix(ctx.Req.RequestURI, "watch") {
return return
} }
ctx.SetCookie("redirect_to", "/"+url.QueryEscape(setting.AppSubUrl+ctx.Req.RequestURI), 0, setting.AppSubUrl) println(url.QueryEscape(setting.AppSubUrl + ctx.Req.RequestURI))
ctx.SetCookie("redirect_to", url.QueryEscape(setting.AppSubUrl+ctx.Req.RequestURI), 0, setting.AppSubUrl)
ctx.Redirect(setting.AppSubUrl + "/user/login") ctx.Redirect(setting.AppSubUrl + "/user/login")
return return
} else if !ctx.User.IsActive && setting.Service.RegisterEmailConfirm { } else if !ctx.User.IsActive && setting.Service.RegisterEmailConfirm {