summaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2015-08-19 04:58:45 +0800
committerUnknwon <u@gogs.io>2015-08-19 04:58:45 +0800
commit47ac579f092cef9128fa0c74798ecaffa2c888f9 (patch)
treef1df7b8742fe72c36aaaf3330a196b090e3dbc54 /modules
parent928d9fc1d42fdc030cbf3847a0370f5088548379 (diff)
downloadgitea-47ac579f092cef9128fa0c74798ecaffa2c888f9.tar.gz
gitea-47ac579f092cef9128fa0c74798ecaffa2c888f9.zip
only assign auto-admin when sign up by web
Diffstat (limited to 'modules')
-rw-r--r--modules/middleware/auth.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/middleware/auth.go b/modules/middleware/auth.go
index db643ccf28..f607460037 100644
--- a/modules/middleware/auth.go
+++ b/modules/middleware/auth.go
@@ -80,7 +80,7 @@ func Toggle(options *ToggleOptions) macaron.Handler {
return
}
- if !options.SignOutRequire && !options.DisableCsrf && ctx.Req.Method == "POST" {
+ if !options.SignOutRequire && !options.DisableCsrf && ctx.Req.Method == "POST" && !auth.IsAPIPath(ctx.Req.URL.Path) {
csrf.Validate(ctx.Context, ctx.csrf)
if ctx.Written() {
return