You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Basically, I'm in the front-end of the development, and at this point I'd like to have a mock log in. The thing is, I apparently can't get it to work even using the example in the documentation. After I attempt the useSignIn method, it falls back on the login page again (fallback declaration below). It doesn't return anything falsey, so it does get to the navigate, but it logs false to "isAuthenticated". The timeout was an attempt of checking if it had anything to do with state updates.
This is how I'm trying to call it in my Login page:
consthandleSubmit=(e)=>{e.preventDefault();if(!password||!email){return;}console.log('email',email);console.log('password',password);if(signIn({auth: {token: 'ey.........o1',type: 'Bearer',},userState: {name: 'The Dev',uuid: 'fff-fff-ffff',},})){setTimeout(()=>{console.log(isAuthenticated);},1000,);navigate('/');}else{console.log('Not logged in');}};
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Basically, I'm in the front-end of the development, and at this point I'd like to have a mock log in. The thing is, I apparently can't get it to work even using the example in the documentation. After I attempt the useSignIn method, it falls back on the login page again (fallback declaration below). It doesn't return anything falsey, so it does get to the navigate, but it logs false to "isAuthenticated". The timeout was an attempt of checking if it had anything to do with state updates.
This is how I'm trying to call it in my Login page:
My browser router its:
and my AppLayout is where i have my outlet:
Beta Was this translation helpful? Give feedback.
All reactions