diff --git a/srcs/requirements/svelte/api_front/src/pages/SplashPage.svelte b/srcs/requirements/svelte/api_front/src/pages/SplashPage.svelte index f5e98f95..d17c1cc3 100644 --- a/srcs/requirements/svelte/api_front/src/pages/SplashPage.svelte +++ b/srcs/requirements/svelte/api_front/src/pages/SplashPage.svelte @@ -50,8 +50,8 @@ // to clean up local storage... as a precaution // this condition isn't good enough... - // if (user && user.statusCode && user.statusCode === 403) { - if (user === undefined) { + // if (user === undefined) { + if (user && user.statusCode && user.statusCode === 403) { console.log('on mount no user, returned status code 403 so logging out of userStore') userLogout(); // which i think should delete any previous local storage } @@ -63,6 +63,7 @@ window.location.href = 'http://transcendance:8080/api/v2/auth'; // await fetch ('http://transcendance:8080/api/v2/auth'); console.log('you are now logged in'); + push('/profile') // ok giving our new local storage and store combo a go // what i need is to set the store to the user when this button get's pressed @@ -83,7 +84,8 @@ } // i could prolly put this in it's own compoent, i seem to use it in several places... or maybe just some JS? like no need for html - const logout = async() => { +// we could .then( () => replace('/') ) need the func so TS compatible... + const logout = async() => { await fetch('http://transcendance:8080/api/v2/auth/logout', { method: 'POST', }); diff --git a/srcs/requirements/svelte/api_front/src/pages/TwoFactorAuthentication.svelte b/srcs/requirements/svelte/api_front/src/pages/TwoFactorAuthentication.svelte index 5d1cb717..e839f3da 100644 --- a/srcs/requirements/svelte/api_front/src/pages/TwoFactorAuthentication.svelte +++ b/srcs/requirements/svelte/api_front/src/pages/TwoFactorAuthentication.svelte @@ -1,6 +1,7 @@