mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2026-05-13 06:20:24 +00:00
fix: verify code challenge of S256
We do not know for sure, but it is quite likely someone assumed implicit fallthrough. This meant that if someone used S256 for PKCE, it simply did not verify the code challenge and always accepted it. PKCE only started working recently as it was broken for a long time already, forgejo/forgejo!8678
This commit is contained in:
parent
df79ccf7d8
commit
d1c7b04d09
1 changed files with 1 additions and 2 deletions
|
|
@ -480,8 +480,7 @@ func AuthorizeOAuth(ctx *context.Context) {
|
|||
|
||||
// pkce support
|
||||
switch form.CodeChallengeMethod {
|
||||
case "S256":
|
||||
case "plain":
|
||||
case "S256", "plain":
|
||||
if err := ctx.Session.Set("CodeChallengeMethod", form.CodeChallengeMethod); err != nil {
|
||||
handleAuthorizeError(ctx, AuthorizeError{
|
||||
ErrorCode: ErrorCodeServerError,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue