-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adapt workflows - Add id provider to auth - Add logout #70
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Quelques petites remarques
src/hooks/useAuth.ts
Outdated
const { logout } = useOidc({ assertUserLoggedIn: true }); | ||
return logout; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tu peux simplifier return useOidc({ assertUserLoggedIn: true }).logout
@@ -5,7 +5,7 @@ const { OidcProvider, useOidc } = await createAppOidc(); | |||
|
|||
export const useHasRole = (role: string): boolean => { | |||
const { oidcTokens } = useOidc({ assertUserLoggedIn: true }); | |||
return oidcTokens.decodedIdToken.inseegroupdefault.includes(role); | |||
return oidcTokens.decodedIdToken.inseegroupedefaut.includes(role); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Il manque pas un d et un l là ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Non j'ai rectifié le nom aux endroits ou cela apparait dans l'appli, le token porte bien un vecteur "inseegroupedefaut" (écriture française)
src/hooks/useAuth.ts
Outdated
@@ -25,7 +30,7 @@ export function useIsAuthenticated(): boolean { | |||
} | |||
login({ | |||
doesCurrentHrefRequiresAuth: false, | |||
extraQueryParams: { kc_idp_hint: "insee-ssp" }, | |||
extraQueryParams: { kc_idp_hint: import.meta.env.VITE_IDENTITY_PROVIDER }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Jme demande si c'est utile vu que tu l'a mis au niveau du createOidc (jte laisse vérifier)
Quality Gate passedKudos, no new issues were introduced! 0 New issues |
No description provided.