mirror of
https://github.com/usebruno/bruno.git
synced 2024-11-25 17:33:28 +01:00
This commit is contained in:
parent
e2d1f52993
commit
5f35d71b8b
@ -47,10 +47,13 @@ const getOAuth2AuthorizationCode = (request, codeChallenge) => {
|
|||||||
const { oauth2 } = request;
|
const { oauth2 } = request;
|
||||||
const { callbackUrl, clientId, authorizationUrl, scope, pkce } = oauth2;
|
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) {
|
if (pkce) {
|
||||||
authorizationUrlWithQueryParams += `&code_challenge=${codeChallenge}&code_challenge_method=S256`;
|
oauth2QueryParams += `&code_challenge=${codeChallenge}&code_challenge_method=S256`;
|
||||||
}
|
}
|
||||||
|
const authorizationUrlWithQueryParams = authorizationUrl + oauth2QueryParams;
|
||||||
try {
|
try {
|
||||||
const { authorizationCode } = await authorizeUserInWindow({
|
const { authorizationCode } = await authorizeUserInWindow({
|
||||||
authorizeUrl: authorizationUrlWithQueryParams,
|
authorizeUrl: authorizationUrlWithQueryParams,
|
||||||
|
Loading…
Reference in New Issue
Block a user