OAuth: send PKCE code verifier with token request (#640)

* OAuth: send PKCE code verifier with token request

* Prevents typescript's warning

Co-authored-by: xmflsct <me@xmflsct.com>
This commit is contained in:
vitalyster 2023-01-08 20:06:30 +03:00 committed by GitHub
parent 972ae46d45
commit 59a2d932e3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -96,7 +96,10 @@ const ComponentInstance: React.FC<Props> = ({
scopes: ['read', 'write', 'follow', 'push'],
redirectUri,
code: promptResult.params.code,
extraParams: { grant_type: 'authorization_code' }
extraParams: {
grant_type: 'authorization_code',
...(request.codeVerifier && { code_verifier: request.codeVerifier })
}
},
{ tokenEndpoint: `https://${variables.domain}/oauth/token` }
)