only assign auto-admin when sign up by web
This commit is contained in:
parent
928d9fc1d4
commit
47ac579f09
4 changed files with 14 additions and 12 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue