Skip to content

Commit 8ec6ebf

Browse files
committed
import payload as type
1 parent 667f636 commit 8ec6ebf

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/lib/utilities/route-for.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { BROWSER } from 'esm-env';
2-
import { InvalidTokenError, jwtDecode, JwtPayload } from 'jwt-decode';
2+
import { InvalidTokenError, jwtDecode, type JwtPayload } from 'jwt-decode';
33

44
import { base } from '$app/paths';
55

@@ -301,7 +301,9 @@ export const routeForOIDCImplicitCallback = (): string => {
301301
}
302302

303303
const state = hash.get('state');
304-
const redirectUrl = new URL(sessionStorage.getItem(state) ?? '/');
304+
const redirectUrl = new URL(
305+
(state ? sessionStorage.getItem(state) : null) ?? '/',
306+
);
305307
sessionStorage.removeItem('state');
306308

307309
setAuthUser(

0 commit comments

Comments
 (0)