Skip to content

Commit

Permalink
import payload as type
Browse files Browse the repository at this point in the history
  • Loading branch information
bgerrity committed Mar 18, 2024
1 parent 667f636 commit 8ec6ebf
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/lib/utilities/route-for.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { BROWSER } from 'esm-env';
import { InvalidTokenError, jwtDecode, JwtPayload } from 'jwt-decode';
import { InvalidTokenError, jwtDecode, type JwtPayload } from 'jwt-decode';

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

Expand Down Expand Up @@ -301,7 +301,9 @@ export const routeForOIDCImplicitCallback = (): string => {
}

const state = hash.get('state');
const redirectUrl = new URL(sessionStorage.getItem(state) ?? '/');
const redirectUrl = new URL(
(state ? sessionStorage.getItem(state) : null) ?? '/',
);
sessionStorage.removeItem('state');

setAuthUser(
Expand Down

0 comments on commit 8ec6ebf

Please sign in to comment.