mirror of
https://github.com/TECHNOFAB11/svelte-oidc.git
synced 2025-12-11 23:50:06 +01:00
fix: user not defined after auth
This commit is contained in:
parent
4fd62abe31
commit
c6f7bcef5f
1 changed files with 8 additions and 4 deletions
|
|
@ -95,10 +95,14 @@
|
|||
}
|
||||
|
||||
const user = await oidc.getUser();
|
||||
isAuthenticated.set(!!user);
|
||||
accessToken.set(user.access_token);
|
||||
idToken.set(user.id_token);
|
||||
userInfo.set(user.profile);
|
||||
|
||||
if (user && !!user) {
|
||||
isAuthenticated.set(true);
|
||||
console.log('user', user);
|
||||
accessToken.set(user.access_token);
|
||||
idToken.set(user.id_token);
|
||||
userInfo.set(user.profile);
|
||||
}
|
||||
isLoading.set(false);
|
||||
}
|
||||
async function handleOnDestroy() {}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue