mirror of
https://github.com/TECHNOFAB11/svelte-oidc.git
synced 2025-12-10 23:20:05 +01:00
...
This commit is contained in:
parent
2cc87c0b95
commit
e738e1dbfb
2 changed files with 5 additions and 1 deletions
|
|
@ -7,6 +7,7 @@
|
|||
/**
|
||||
* Stores
|
||||
*/
|
||||
export const hasData = writable(false);
|
||||
export const isLoading = writable(true);
|
||||
export const isAuthenticated = writable(false);
|
||||
export const accessToken = writable('');
|
||||
|
|
@ -111,10 +112,11 @@
|
|||
accessToken.set(user.access_token);
|
||||
idToken.set(user.id_token);
|
||||
userInfo.set(user.profile);
|
||||
isLoading.set(false);
|
||||
hasData.set(true);
|
||||
});
|
||||
|
||||
userManager.events.addUserUnloaded(function() {
|
||||
hasData.set(false);
|
||||
isAuthenticated.set(false);
|
||||
idToken.set('');
|
||||
accessToken.set('');
|
||||
|
|
@ -171,6 +173,7 @@
|
|||
else if (params.has('state')) {
|
||||
const response = await oidc.signinCallback();
|
||||
}
|
||||
isLoading.set(false);
|
||||
}
|
||||
async function handleOnDestroy() {}
|
||||
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ export {
|
|||
accessToken,
|
||||
isAuthenticated,
|
||||
isLoading,
|
||||
hasData,
|
||||
login,
|
||||
logout,
|
||||
refreshToken,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue