Client - add PKCE support when authorizing an app
This commit is contained in:
parent
922ff63d99
commit
b96a682eb8
@ -73,7 +73,15 @@
|
||||
redirect_uri: `${route.query.redirect_uri}`,
|
||||
response_type: `${route.query.response_type}`,
|
||||
scope: `${route.query.scope}`,
|
||||
state: `${route.query.state}`,
|
||||
state: `${route.query.state ? route.query.state : ''}`,
|
||||
code_challenge: `${
|
||||
route.query.code_challenge ? route.query.code_challenge : ''
|
||||
}`,
|
||||
code_challenge_method: `${
|
||||
route.query.code_challenge_method
|
||||
? route.query.code_challenge_method
|
||||
: ''
|
||||
}`,
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
@ -43,6 +43,12 @@ export const actions: ActionTree<IOAuth2State, IRootState> & IOAuth2Actions = {
|
||||
if (payload.state) {
|
||||
form.set('state', payload.state)
|
||||
}
|
||||
if (payload.code_challenge) {
|
||||
form.set('code_challenge', payload.code_challenge)
|
||||
}
|
||||
if (payload.code_challenge_method) {
|
||||
form.set('code_challenge_method', payload.code_challenge_method)
|
||||
}
|
||||
|
||||
authApi
|
||||
.post('oauth/authorize', form, {
|
||||
|
@ -27,5 +27,7 @@ export interface IOAuth2ClientAuthorizePayload {
|
||||
redirect_uri: string
|
||||
response_type: string
|
||||
scope: string
|
||||
state?: string
|
||||
state: string
|
||||
code_challenge: string
|
||||
code_challenge_method: string
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user