only assign auto-admin when sign up by web

This commit is contained in:
Unknwon committed 2015-08-19 04:58:45 +08:00
1 parent 928d9fc1d4
commit 47ac579f09
4 files changed
+14 -12

No files matched your search

+1 -1
View File
@@ -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