From f6759a731a063d5d2be8a932f8d1e1a784cc0528 Mon Sep 17 00:00:00 2001 From: Unknwon Date: Fri, 4 Mar 2016 09:15:11 -0500 Subject: [PATCH] #2748 fix redirect loop with auto-signin --- README.md | 2 +- gogs.go | 2 +- modules/middleware/auth.go | 3 ++- templates/.VERSION | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index a291d8c7bb9..895217d35b5 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ Gogs - Go Git Service [![Build Status](https://travis-ci.org/gogits/gogs.svg?bra ![](https://github.com/gogits/gogs/blob/master/public/img/gogs-large-resize.png?raw=true) -##### Current version: 0.8.53 +##### Current version: 0.8.54 | Web | UI | Preview | |:-------------:|:-------:|:-------:| diff --git a/gogs.go b/gogs.go index 86adb081acd..3f7f4f4b552 100644 --- a/gogs.go +++ b/gogs.go @@ -17,7 +17,7 @@ import ( "github.com/gogits/gogs/modules/setting" ) -const APP_VER = "0.8.53.0303" +const APP_VER = "0.8.54.0304" func init() { runtime.GOMAXPROCS(runtime.NumCPU()) diff --git a/modules/middleware/auth.go b/modules/middleware/auth.go index e7460fc6dde..4e549a07825 100644 --- a/modules/middleware/auth.go +++ b/modules/middleware/auth.go @@ -113,7 +113,8 @@ func Toggle(options *ToggleOptions) macaron.Handler { if !options.SignOutRequire && !ctx.IsSigned && !auth.IsAPIPath(ctx.Req.URL.Path) && len(ctx.GetCookie(setting.CookieUserName)) > 0 { ctx.SetCookie("redirect_to", url.QueryEscape(setting.AppSubUrl+ctx.Req.RequestURI), 0, setting.AppSubUrl) - ctx.Redirect(setting.AppSubUrl + ctx.Req.RequestURI) + ctx.Redirect(setting.AppSubUrl + "/user/login") + return } if options.AdminRequire { diff --git a/templates/.VERSION b/templates/.VERSION index 07a96ab49f1..fa5080398fd 100644 --- a/templates/.VERSION +++ b/templates/.VERSION @@ -1 +1 @@ -0.8.53.0303 \ No newline at end of file +0.8.54.0304 \ No newline at end of file