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

View File

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