fix: change fetchingUser to false after fetching profile
This commit is contained in:
@@ -245,9 +245,10 @@
|
|||||||
// return goto('/login?redirect=/' + path);
|
// return goto('/login?redirect=/' + path);
|
||||||
// }
|
// }
|
||||||
|
|
||||||
const { data: authListener } = supabase.auth.onAuthStateChange(async (event, session) => {
|
const { data: authListener } = supabase.auth.onAuthStateChange((event, session) => {
|
||||||
// Log key events
|
// Log key events
|
||||||
console.log(`event`, event);
|
console.log(`event`, event);
|
||||||
|
console.log(`session`, session);
|
||||||
if (event == 'PASSWORD_RECOVERY') {
|
if (event == 'PASSWORD_RECOVERY') {
|
||||||
console.log('PASSWORD RESET');
|
console.log('PASSWORD RESET');
|
||||||
}
|
}
|
||||||
@@ -263,8 +264,9 @@
|
|||||||
// Authentication Steps
|
// Authentication Steps
|
||||||
if (event === 'SIGNED_IN' || event === 'INITIAL_SESSION') {
|
if (event === 'SIGNED_IN' || event === 'INITIAL_SESSION') {
|
||||||
$user.fetchingUser = true;
|
$user.fetchingUser = true;
|
||||||
await getProfile();
|
getProfile().then(() => {
|
||||||
$user.fetchingUser = false;
|
$user.fetchingUser = false;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
// else if (!['TOKEN_REFRESHED'].includes(event)) {
|
// else if (!['TOKEN_REFRESHED'].includes(event)) {
|
||||||
// console.log('not logged in, go to login');
|
// console.log('not logged in, go to login');
|
||||||
|
|||||||
Reference in New Issue
Block a user