tangled
alpha
login
or
join now
whey.party
/
forumtest
7
fork
atom
ATProto forum built with ESAV
7
fork
atom
overview
issues
pulls
pipelines
callback redirect
rimar1337
7 months ago
54126436
2ff6b79a
+5
-1
3 changed files
expand all
collapse all
unified
split
.gitignore
src
providers
OAuthProvider.tsx
routes
callback
index.tsx
+1
.gitignore
···
7
.env
8
.nitro
9
.tanstack
0
···
7
.env
8
.nitro
9
.tanstack
10
+
public/client-metadata.json
+1
src/providers/OAuthProvider.tsx
···
66
67
const startLogin = useCallback(async (handleOrPdsUrl: string) => {
68
if (status !== 'signedOut') return;
0
69
try {
70
await oauthClient.signIn(handleOrPdsUrl);
71
} catch (err) {
···
66
67
const startLogin = useCallback(async (handleOrPdsUrl: string) => {
68
if (status !== 'signedOut') return;
69
+
sessionStorage.setItem('postLoginRedirect', window.location.pathname + window.location.search);
70
try {
71
await oauthClient.signIn(handleOrPdsUrl);
72
} catch (err) {
+3
-1
src/routes/callback/index.tsx
···
6
7
function RouteComponent() {
8
const navigate = useNavigate()
9
-
navigate({to:"/"})
0
0
10
return <div>Hello "/callback/"!</div>
11
}
···
6
7
function RouteComponent() {
8
const navigate = useNavigate()
9
+
const redirectPath = sessionStorage.getItem('postLoginRedirect') || '/';
10
+
navigate({to:redirectPath})
11
+
sessionStorage.removeItem('postLoginRedirect');
12
return <div>Hello "/callback/"!</div>
13
}