feat: émettrice SSO draco_session — cookie partagé .dracodev.net, renouvellement et révocation (#216)
This commit is contained in:
@@ -121,6 +121,25 @@ const AuthManager = {
|
||||
if (tokenData.user) {
|
||||
sessionStorage.setItem(this.USER_KEY, JSON.stringify(tokenData.user));
|
||||
}
|
||||
this._honorReturnTo();
|
||||
},
|
||||
|
||||
// Fusion ACC-3.1 (#216) : après connexion chez l'émettrice SSO,
|
||||
// repartir vers l'application demanderesse. Le return_to est
|
||||
// re-validé ici (https + domaine dracodev.net, jamais l'hôte
|
||||
// courant) en plus de la validation serveur de /sso/authorize.
|
||||
_honorReturnTo() {
|
||||
try {
|
||||
const rt = new URLSearchParams(window.location.search).get("return_to");
|
||||
if (!rt) return;
|
||||
const u = new URL(rt);
|
||||
const okHost = u.hostname === "dracodev.net"
|
||||
|| u.hostname.endsWith(".dracodev.net");
|
||||
if (u.protocol === "https:" && okHost
|
||||
&& u.hostname !== window.location.hostname) {
|
||||
window.location.replace(rt);
|
||||
}
|
||||
} catch (e) { /* return_to illisible : on reste sur place */ }
|
||||
},
|
||||
|
||||
getToken() {
|
||||
|
||||
Reference in New Issue
Block a user