mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-11-10 12:15:43 +01:00
Send error message when CSRF token is missing (#13676)
This commit is contained in:
parent
2791cc139e
commit
247ab6a922
1 changed files with 1 additions and 1 deletions
|
@ -169,7 +169,7 @@ func (ctx *APIContext) RequireCSRF() {
|
||||||
if len(headerToken) > 0 || len(formValueToken) > 0 {
|
if len(headerToken) > 0 || len(formValueToken) > 0 {
|
||||||
csrf.Validate(ctx.Context.Context, ctx.csrf)
|
csrf.Validate(ctx.Context.Context, ctx.csrf)
|
||||||
} else {
|
} else {
|
||||||
ctx.Context.Error(401)
|
ctx.Context.Error(401, "Missing CSRF token.")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue