diff --git a/apps/ops/src/api/auth.js b/apps/ops/src/api/auth.js index ad27e7a..7056138 100644 --- a/apps/ops/src/api/auth.js +++ b/apps/ops/src/api/auth.js @@ -88,5 +88,9 @@ export async function getLoggedUser () { } export async function logout () { - window.location.href = 'https://auth.targo.ca/if/flow/default-invalidation-flow/' + // Déconnexion Authentik PUIS retour sur OPS : le flow d'invalidation honore `?next=` → il renvoie vers OPS, + // qui (non authentifié) redéclenche le login Authentik AVEC chemin de retour → après login on revient sur OPS, + // au lieu d'atterrir sur la page par défaut d'Authentik (/if/user/#/library). + const back = window.location.origin + (import.meta.env.BASE_URL || '/') // ex. https://erp.gigafibre.ca/ops/ + window.location.href = 'https://auth.targo.ca/if/flow/default-invalidation-flow/?next=' + encodeURIComponent(back) }