From 01bcd6476d94d4390d4dc87f76eebeafd8f18b3c Mon Sep 17 00:00:00 2001 From: louispaulb Date: Fri, 3 Jul 2026 17:25:41 -0400 Subject: [PATCH] =?UTF-8?q?fix(ops):=20la=20d=C3=A9connexion=20ram=C3=A8ne?= =?UTF-8?q?=20sur=20OPS=20apr=C3=A8s=20login=20(plus=20la=20page=20Authent?= =?UTF-8?q?ik)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit logout() ajoute `?next=` au flow d'invalidation Authentik : après déconnexion, Authentik renvoie vers erp.gigafibre.ca/ops → qui (non authentifié) redéclenche le login AVEC chemin de retour → après login on revient sur OPS, au lieu d'atterrir sur /if/user/#/library. Sans régression si Authentik ignore `next` (= comportement actuel). Co-Authored-By: Claude Opus 4.8 --- apps/ops/src/api/auth.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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) }