fixes auth?
This commit is contained in:
@@ -11,13 +11,27 @@ const userConfig: AuthProviderProps = {
|
||||
redirect_uri: REDIRECT_URI,
|
||||
response_type: "code",
|
||||
includeIdTokenInSilentRenew: true,
|
||||
automaticSilentRenew: false, //TODO: Dit moet dus denk ik wel gewoon aan?
|
||||
automaticSilentRenew: false, // We skippen automatic silent en doen het zelf hieronder.
|
||||
scope: "openid profile email offline_access", //TODO: Iets met scopes.
|
||||
accessTokenExpiringNotificationTimeInSeconds: 5 * 60,
|
||||
//accessTokenExpiringNotificationTimeInSeconds: 1 * 60,
|
||||
loadUserInfo: true,
|
||||
post_logout_redirect_uri: ORIGIN_URI,
|
||||
response_mode: "query",
|
||||
revokeTokensOnSignout: true,
|
||||
};
|
||||
|
||||
export const userManager = new UserManager(userConfig);
|
||||
|
||||
// Some handling of token expiration.
|
||||
// Hopefully this means login timeout issues are prevented somewhat.
|
||||
userManager.events.addAccessTokenExpiring(() => {
|
||||
console.warn("Access token expiring, silently renewing...");
|
||||
userManager.signinSilent(); //TODO: uitzoeken bij welke callback dit trecht komt
|
||||
});
|
||||
|
||||
userManager.events.addAccessTokenExpired(() => {
|
||||
console.warn("Access token expired, redirecting to login...");
|
||||
userManager.signinRedirect();
|
||||
});
|
||||
|
||||
export const oidcConfig = { ...userConfig, userManager };
|
||||
|
||||
Reference in New Issue
Block a user