fixed redirect_uri parameter #891

This commit is contained in:
SPRINX0\prochazka
2024-09-24 14:45:00 +02:00
parent 632421eb73
commit 85bfb1986d

View File

@@ -45,6 +45,12 @@
}
}
function extractRedirectUri() {
const res = (location.origin + location.pathname).replace(/\/login.html$/, '/');
console.log('Using redirect URI:', res);
return res;
}
async function processSingleProvider(provider) {
if (provider.workflowType == 'redirect') {
await processRedirectLogin(provider.amoid);
@@ -86,7 +92,7 @@
const resp = await apiCall('auth/redirect', {
amoid: amoid,
state,
redirectUri: location.origin + location.pathname,
redirectUri: extractRedirectUri(),
});
const { uri } = resp;
@@ -194,9 +200,7 @@
// }`
// );
internalRedirectTo(
`/connections/dblogin-web?conid=${selectedConnection?.conid}&state=${encodeURIComponent(state)}&redirectUri=${
location.origin + location.pathname
}`
`/connections/dblogin-web?conid=${selectedConnection?.conid}&state=${encodeURIComponent(state)}&redirectUri=${extractRedirectUri()}`
);
}}
/>