fix(Auth): fixed redirect
This commit is contained in:
parent
5e1d63289b
commit
3b704d2500
@ -86,6 +86,10 @@ export class AuthController {
|
||||
store.dispatch(setRelayMapAction(relayMap.map))
|
||||
}
|
||||
|
||||
const currentLocation = window.location.hash.replace('#', '')
|
||||
|
||||
if (!Object.values(appPrivateRoutes).includes(currentLocation)) {
|
||||
// User did change the location to one of the private routes
|
||||
const visitedLink = getVisitedLink()
|
||||
|
||||
if (visitedLink) {
|
||||
@ -97,6 +101,7 @@ export class AuthController {
|
||||
return Promise.resolve(appPrivateRoutes.homePage)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
checkSession() {
|
||||
const savedAuthToken = getAuthToken()
|
||||
|
@ -82,7 +82,8 @@ export const Login = () => {
|
||||
const redirectPath =
|
||||
await authController.authAndGetMetadataAndRelaysMap(pubkey)
|
||||
|
||||
navigateAfterLogin(redirectPath)
|
||||
if (redirectPath) navigateAfterLogin(redirectPath)
|
||||
|
||||
})
|
||||
.catch((err) => {
|
||||
toast.error('Error capturing public key from nostr extension: ' + err)
|
||||
|
Loading…
Reference in New Issue
Block a user