fix(auth): return to origin path after GitHub login

Sign-in saves the current path in sessionStorage so the OAuth callback
can route back instead of always landing on Home.
This commit is contained in:
Julien Calixte
2026-05-29 16:49:44 +02:00
parent a09e541fa8
commit d99672dbd8
3 changed files with 30 additions and 2 deletions

View File

@@ -0,0 +1,7 @@
export const GITHUB_OAUTH_RETURN_PATH_KEY = "github-oauth-return-path"
export const consumeGithubOAuthReturnPath = (): string | null => {
const path = sessionStorage.getItem(GITHUB_OAUTH_RETURN_PATH_KEY)
sessionStorage.removeItem(GITHUB_OAUTH_RETURN_PATH_KEY)
return path
}