mirror of
https://github.com/usebruno/bruno.git
synced 2024-11-21 23:43:15 +01:00
This commit is contained in:
parent
e2d1f52993
commit
5f35d71b8b
@ -47,10 +47,13 @@ const getOAuth2AuthorizationCode = (request, codeChallenge) => {
|
||||
const { oauth2 } = request;
|
||||
const { callbackUrl, clientId, authorizationUrl, scope, pkce } = oauth2;
|
||||
|
||||
let authorizationUrlWithQueryParams = `${authorizationUrl}?client_id=${clientId}&redirect_uri=${callbackUrl}&response_type=code&scope=${scope}`;
|
||||
let oauth2QueryParams =
|
||||
(authorizationUrl.indexOf('?') > -1 ? '&' : '?') +
|
||||
`client_id=${clientId}&redirect_uri=${callbackUrl}&response_type=code&scope=${scope}`;
|
||||
if (pkce) {
|
||||
authorizationUrlWithQueryParams += `&code_challenge=${codeChallenge}&code_challenge_method=S256`;
|
||||
oauth2QueryParams += `&code_challenge=${codeChallenge}&code_challenge_method=S256`;
|
||||
}
|
||||
const authorizationUrlWithQueryParams = authorizationUrl + oauth2QueryParams;
|
||||
try {
|
||||
const { authorizationCode } = await authorizeUserInWindow({
|
||||
authorizeUrl: authorizationUrlWithQueryParams,
|
||||
|
Loading…
Reference in New Issue
Block a user