summaryrefslogtreecommitdiffstats
path: root/modules/middleware/auth.go
diff options
context:
space:
mode:
authorUnknown <joe2010xtmf@163.com>2014-03-22 17:59:22 -0400
committerUnknown <joe2010xtmf@163.com>2014-03-22 17:59:22 -0400
commit7356153ba3c19ff49f3ecfa28bac0b8bb38eccb9 (patch)
treed6cb7f9a7317eaddc981708e2a104020370e66d7 /modules/middleware/auth.go
parentcb52f6d07d62925a31185fedf591d0241ee2bf63 (diff)
downloadgitea-7356153ba3c19ff49f3ecfa28bac0b8bb38eccb9.tar.gz
gitea-7356153ba3c19ff49f3ecfa28bac0b8bb38eccb9.zip
Batch updates
Diffstat (limited to 'modules/middleware/auth.go')
-rw-r--r--modules/middleware/auth.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/modules/middleware/auth.go b/modules/middleware/auth.go
index 3224b3df91..82c3367c48 100644
--- a/modules/middleware/auth.go
+++ b/modules/middleware/auth.go
@@ -5,6 +5,8 @@
package middleware
import (
+ "net/url"
+
"github.com/codegangsta/martini"
"github.com/gogits/gogs/modules/base"
@@ -35,6 +37,7 @@ func Toggle(options *ToggleOptions) martini.Handler {
if options.SignInRequire {
if !ctx.IsSigned {
+ ctx.SetCookie("redirect_to", "/"+url.QueryEscape(ctx.Req.RequestURI))
ctx.Redirect("/user/login")
return
} else if !ctx.User.IsActive && base.Service.RegisterEmailConfirm {