Checkpoint: Correction de la redirection OAuth pour revenir à l'application après authentification. Le callback OAuth décode maintenant le state pour rediriger vers /admin au lieu de rester sur le tableau de bord Manus. Le système gère maintenant correctement les deux modes d'authentification (local + OAuth).
This commit is contained in:
@@ -11,8 +11,9 @@ export const getLoginUrl = () => "/login";
|
||||
export const getOAuthLoginUrl = () => {
|
||||
const appId = import.meta.env.VITE_APP_ID;
|
||||
const portalUrl = import.meta.env.VITE_OAUTH_PORTAL_URL;
|
||||
const currentUrl = window.location.href;
|
||||
// Toujours rediriger vers /admin après OAuth
|
||||
const redirectAfterAuth = `${window.location.origin}/admin`;
|
||||
const redirectUri = `${window.location.origin}/api/oauth/callback`;
|
||||
const state = btoa(currentUrl);
|
||||
const state = btoa(redirectAfterAuth);
|
||||
return `${portalUrl}?appId=${appId}&redirectUri=${encodeURIComponent(redirectUri)}&state=${encodeURIComponent(state)}&responseType=code`;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user