-
Notifications
You must be signed in to change notification settings - Fork 244
Open
Description
Version:
oidc-client-ts: "3.2.1"
I used the SignInPopop mode of UserManager in vue3. After the callback, the token has been obtained. I also checked localstorage and the information has been stored, but I can't get the callback user. I can't get it manually by calling userManager.getUser.
function getUserManager() {
if (!userManager.value) {
const oidcSettings: UserManagerSettings = {
authority: 'https://localhost:44372',
client_id: 'WmsApi_App',
scope: 'openid profile email phone roles',
redirect_uri: `${window.location.origin}/auth/callback`,
post_logout_redirect_uri: `${window.location.origin}/auth/login`,
popup_redirect_uri: `${window.location.origin}/auth/callback`,
popup_post_logout_redirect_uri: `${window.location.origin}/auth/login`,
response_type: 'code',
userStore: new WebStorageStateStore({store: window
.localStorage
}),
response_mode: 'fragment',
};
userManager.value = new UserManager(oidcSettings);
}
return userManager.value!;
}
const manager = getUserManager();
await manager.signinPopup();
const userManager = authStore.getUserManager();
const user = await userManager.signinCallback();
The above is my code, the user here is always not available.
Even if I use const user = await userManager.getUser();
I still can't get it, but I checked the internal information of the browser and there is no problem.
I switched to redirect and everything is normal. What is the reason?
Metadata
Metadata
Assignees
Labels
No labels