+1
src/providers/OAuthProvider.tsx
+1
src/providers/OAuthProvider.tsx
···
66
66
67
67
const startLogin = useCallback(async (handleOrPdsUrl: string) => {
68
68
if (status !== 'signedOut') return;
69
+
sessionStorage.setItem('postLoginRedirect', window.location.pathname + window.location.search);
69
70
try {
70
71
await oauthClient.signIn(handleOrPdsUrl);
71
72
} catch (err) {
+3
-1
src/routes/callback/index.tsx
+3
-1
src/routes/callback/index.tsx
···
6
6
7
7
function RouteComponent() {
8
8
const navigate = useNavigate()
9
-
navigate({to:"/"})
9
+
const redirectPath = sessionStorage.getItem('postLoginRedirect') || '/';
10
+
navigate({to:redirectPath})
11
+
sessionStorage.removeItem('postLoginRedirect');
10
12
return <div>Hello "/callback/"!</div>
11
13
}