ci: docker_tag=ext feat(front): callback bridge authorized-bridge; bump 0.1.6; changelog
All checks were successful
build-and-push-ext / build_push (push) Successful in 1m31s

This commit is contained in:
Debian Dev4 2025-09-18 22:20:19 +00:00
parent 387e7ed65c
commit 5af06c76f6
3 changed files with 42 additions and 2 deletions

View File

@ -26,3 +26,10 @@
- Next.js `output: 'standalone'` pour une image runtime plus légère.
- Caches BuildKit (npm et .next) pour accélérer les builds.
- Runtime basé sur `server.js` (standalone) au lieu de `next start`.
## v0.1.6
- Mise en place dun "callback bridge" pour IdNot:
- Page bridge côté domaine autorisé (`/authorized-client`) qui POST le `code` vers `/api/v1/idnot/auth` et redirige.
- Page front `/lecoffre/authorized-bridge` qui consomme `#token`/`#error`, stocke le cookie et redirige vers le tableau de bord.
- Permet le login sans modifier la liste des callbacks autorisés chez IdNot.

View File

@ -1,6 +1,6 @@
{
"name": "lecoffre-front",
"version": "0.1.5",
"version": "0.1.6",
"private": true,
"scripts": {
"dev": "next dev",
@ -37,7 +37,7 @@
"react": "18.2.0",
"react-dom": "18.2.0",
"react-gtm-module": "^2.0.11",
"react-select": "^5.7.2",
"react-toastify": "^9.1.3",
"sass": "^1.59.2",

View File

@ -0,0 +1,33 @@
import { useEffect } from 'react';
import { useRouter } from 'next/router';
import Module from '@Front/Config/Module';
import CookieService from '@Front/Services/CookieService/CookieService';
export default function AuthorizedBridge() {
const router = useRouter();
useEffect(() => {
try {
const hash = typeof window !== 'undefined' ? window.location.hash : '';
const params = new URLSearchParams(hash.replace(/^#/, ''));
const token = params.get('token');
const error = params.get('error');
if (token) {
CookieService.getInstance().setCookie('leCoffreAccessToken', token);
// Aller sur le tableau de bord
window.location.replace(Module.getInstance().get().modules.pages.Folder.props.path);
return;
}
// En cas d'erreur, renvoyer vers la page login avec un code générique
const loginPath = Module.getInstance().get().modules.pages.Login.props.path;
router.replace(`${loginPath}?error=${encodeURIComponent(error || '1')}`);
} catch (_e) {
const loginPath = Module.getInstance().get().modules.pages.Login.props.path;
router.replace(`${loginPath}?error=1`);
}
}, [router]);
return null;
}