fix
Some checks are pending
Run tests / test-runner (push) Waiting to run

This commit is contained in:
Jan Prochazka 2024-08-13 13:53:14 +02:00
parent 838bc34a4f
commit 42a79b2557
2 changed files with 15 additions and 13 deletions

View File

@ -49,6 +49,7 @@ export function handleOauthCallback() {
code: sentCode, code: sentCode,
amoid, amoid,
redirectUri: location.origin + location.pathname, redirectUri: location.origin + location.pathname,
sid,
}).then(authResp => { }).then(authResp => {
const { accessToken, error, errorMessage } = authResp; const { accessToken, error, errorMessage } = authResp;
@ -164,18 +165,18 @@ export async function redirectToLogin(config = null, force = false) {
return; return;
} }
if (config.oauth) { // if (config.oauth) {
const state = `dbg-oauth:${Math.random().toString().substr(2)}`; // const state = `dbg-oauth:${Math.random().toString().substr(2)}`;
const scopeParam = config.oauthScope ? `&scope=${config.oauthScope}` : ''; // const scopeParam = config.oauthScope ? `&scope=${config.oauthScope}` : '';
sessionStorage.setItem('oauthState', state); // sessionStorage.setItem('oauthState', state);
console.log('Redirecting to OAUTH provider'); // console.log('Redirecting to OAUTH provider');
location.replace( // location.replace(
`${config.oauth}?client_id=${config.oauthClient}&response_type=code&redirect_uri=${encodeURIComponent( // `${config.oauth}?client_id=${config.oauthClient}&response_type=code&redirect_uri=${encodeURIComponent(
location.origin + location.pathname // location.origin + location.pathname
)}&state=${encodeURIComponent(state)}${scopeParam}` // )}&state=${encodeURIComponent(state)}${scopeParam}`
); // );
return; // return;
} // }
} }
export function internalRedirectTo(path) { export function internalRedirectTo(path) {

View File

@ -141,6 +141,7 @@ const driver = {
if (connection.authType != 'msentra') return null; if (connection.authType != 'msentra') return null;
return authProxy.authProxyGetRedirectUrl({ return authProxy.authProxyGetRedirectUrl({
...options, ...options,
client: platformInfo.isElectron ? 'app' : 'web',
type: 'msentra', type: 'msentra',
}); });
}, },
@ -157,7 +158,7 @@ driver.initialize = dbgateEnv => {
requireMsnodesqlv8 = dbgateEnv.nativeModules.msnodesqlv8; requireMsnodesqlv8 = dbgateEnv.nativeModules.msnodesqlv8;
} }
platformInfo = dbgateEnv.platformInfo; platformInfo = dbgateEnv.platformInfo;
azureAuth = dbgateEnv.azureAuth; authProxy = dbgateEnv.authProxy;
nativeDriver.initialize(dbgateEnv); nativeDriver.initialize(dbgateEnv);
}; };