mirror of
https://github.com/TECHNOFAB11/svelte-oidc.git
synced 2025-12-11 23:50:06 +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
|
* Stores
|
||||||
*/
|
*/
|
||||||
|
export const hasData = writable(false);
|
||||||
export const isLoading = writable(true);
|
export const isLoading = writable(true);
|
||||||
export const isAuthenticated = writable(false);
|
export const isAuthenticated = writable(false);
|
||||||
export const accessToken = writable('');
|
export const accessToken = writable('');
|
||||||
|
|
@ -111,10 +112,11 @@
|
||||||
accessToken.set(user.access_token);
|
accessToken.set(user.access_token);
|
||||||
idToken.set(user.id_token);
|
idToken.set(user.id_token);
|
||||||
userInfo.set(user.profile);
|
userInfo.set(user.profile);
|
||||||
isLoading.set(false);
|
hasData.set(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
userManager.events.addUserUnloaded(function() {
|
userManager.events.addUserUnloaded(function() {
|
||||||
|
hasData.set(false);
|
||||||
isAuthenticated.set(false);
|
isAuthenticated.set(false);
|
||||||
idToken.set('');
|
idToken.set('');
|
||||||
accessToken.set('');
|
accessToken.set('');
|
||||||
|
|
@ -171,6 +173,7 @@
|
||||||
else if (params.has('state')) {
|
else if (params.has('state')) {
|
||||||
const response = await oidc.signinCallback();
|
const response = await oidc.signinCallback();
|
||||||
}
|
}
|
||||||
|
isLoading.set(false);
|
||||||
}
|
}
|
||||||
async function handleOnDestroy() {}
|
async function handleOnDestroy() {}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@ export {
|
||||||
accessToken,
|
accessToken,
|
||||||
isAuthenticated,
|
isAuthenticated,
|
||||||
isLoading,
|
isLoading,
|
||||||
|
hasData,
|
||||||
login,
|
login,
|
||||||
logout,
|
logout,
|
||||||
refreshToken,
|
refreshToken,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue