Improve delete SSH key

This commit is contained in:
Unknown 2014-05-06 16:28:52 -04:00
parent 7cb5a15c9b
commit 8ca14e2109
14 changed files with 49 additions and 101 deletions

View file

@ -6,6 +6,7 @@ package middleware
import (
"net/url"
"strings"
"github.com/go-martini/martini"
@ -40,6 +41,10 @@ func Toggle(options *ToggleOptions) martini.Handler {
if options.SignInRequire {
if !ctx.IsSigned {
// Ignore watch repository operation.
if strings.HasSuffix(ctx.Req.RequestURI, "watch") {
return
}
ctx.SetCookie("redirect_to", "/"+url.QueryEscape(ctx.Req.RequestURI))
ctx.Redirect("/user/login")
return