Refactored dashboard
This commit is contained in:
@@ -112,11 +112,13 @@ export const AuthProvider: React.FC<{ children: ReactNode }> = ({ children }) =>
|
||||
const sec = getSecuritySettings();
|
||||
const authorityUrl = sec.Authority.replace(/\/+$/, '');
|
||||
|
||||
const dashboardRedirectUri = `${window.location.origin}/dashboard`;
|
||||
|
||||
const mgr = new UserManager({
|
||||
authority: authorityUrl,
|
||||
client_id: sec.ClientId,
|
||||
client_secret: sec.ClientSecret,
|
||||
redirect_uri: window.location.origin,
|
||||
redirect_uri: dashboardRedirectUri,
|
||||
post_logout_redirect_uri: window.location.origin,
|
||||
response_type: 'code',
|
||||
scope: sec.Scope || 'openid profile email roles pfm-api-dev',
|
||||
@@ -212,7 +214,9 @@ export const AuthProvider: React.FC<{ children: ReactNode }> = ({ children }) =>
|
||||
const login = async () => {
|
||||
if (userManager) {
|
||||
try {
|
||||
await userManager.signinRedirect();
|
||||
await userManager.signinRedirect({
|
||||
redirect_uri: `${window.location.origin}/dashboard`,
|
||||
});
|
||||
} catch (err) {
|
||||
console.error('[Auth] Redirect error:', err);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user