diff options
author | Unknwon <u@gogs.io> | 2015-08-19 04:58:45 +0800 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2015-08-19 04:58:45 +0800 |
commit | 47ac579f092cef9128fa0c74798ecaffa2c888f9 (patch) | |
tree | f1df7b8742fe72c36aaaf3330a196b090e3dbc54 /modules | |
parent | 928d9fc1d42fdc030cbf3847a0370f5088548379 (diff) | |
download | gitea-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.go | 2 |
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 |