Initial commit with Email Import Wizard and Task Processor updates
This commit is contained in:
commit
effdc5d59f
170 files changed
+67739
No files matched your search
@@ -0,0 +1,27 @@
|
||||
import { userManager } from './oidc';
|
||||
|
||||
const KEY = 'pm.returnUrl';
|
||||
let redirecting = false;
|
||||
|
||||
export function saveReturnUrl(path: string): void {
|
||||
if (path === '/login' || path.startsWith('/auth/callback')) return;
|
||||
sessionStorage.setItem(KEY, path);
|
||||
}
|
||||
|
||||
export function consumeReturnUrl(): string {
|
||||
const v = sessionStorage.getItem(KEY) ?? '/';
|
||||
sessionStorage.removeItem(KEY);
|
||||
return v;
|
||||
}
|
||||
|
||||
export async function triggerLoginRedirect(): Promise<void> {
|
||||
if (redirecting) return;
|
||||
redirecting = true;
|
||||
saveReturnUrl(window.location.pathname + window.location.search);
|
||||
try {
|
||||
await userManager.removeUser();
|
||||
} catch (err) {
|
||||
console.error('OIDC: removeUser before redirect failed', err);
|
||||
}
|
||||
await userManager.signinRedirect();
|
||||
}
|
||||
Reference in new issue
Block a user