-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: accès au formulaire hors expé pour les utilisateurs de l'expé
- Loading branch information
1 parent
22b22b2
commit 46ec9ac
Showing
22 changed files
with
144 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,11 @@ | ||
import { ResetPasswordForm } from "./ResetPasswordForm"; | ||
|
||
// eslint-disable-next-line import/no-anonymous-default-export, react/display-name | ||
export default async function ({ | ||
const Page = ({ | ||
searchParams: { resetPasswordToken }, | ||
}: { | ||
searchParams: { resetPasswordToken: string }; | ||
}) { | ||
return ( | ||
<div> | ||
<ResetPasswordForm resetPasswordToken={resetPasswordToken} /> | ||
</div> | ||
); | ||
} | ||
}) => ( | ||
<ResetPasswordForm resetPasswordToken={resetPasswordToken} /> | ||
); | ||
|
||
export default Page; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,15 @@ | ||
"use client"; | ||
|
||
import { redirect } from "next/navigation"; | ||
import { hasRole } from "shared"; | ||
import { CODES_REGIONS_EXPE } from "shared/security/securityUtils"; | ||
|
||
import { useAuth } from "@/utils/security/useAuth"; | ||
|
||
// eslint-disable-next-line import/no-anonymous-default-export | ||
export default () => { | ||
|
||
const Page = () => { | ||
const { auth } = useAuth(); | ||
const isPerdir = hasRole({ | ||
user: auth?.user, | ||
role: "perdir", | ||
}); | ||
// Feature flag pour les perdir de la région Occitanie (76) et AURA (84) | ||
// qui font partie du test | ||
const FF_isPerdirPartOfExpe = isPerdir && CODES_REGIONS_EXPE.includes(auth?.user.codeRegion ?? ""); | ||
const isPartOfExpe = CODES_REGIONS_EXPE.includes(auth?.user.codeRegion ?? ""); | ||
|
||
// eslint-disable-next-line @typescript-eslint/no-unused-expressions | ||
FF_isPerdirPartOfExpe ? redirect("/intentions/perdir") : redirect("/intentions/saisie"); | ||
return isPartOfExpe ? redirect("/intentions/perdir/saisie") : redirect("/intentions/saisie"); | ||
}; | ||
export default Page; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,15 @@ | ||
import { redirect } from "next/navigation"; | ||
"use client"; | ||
|
||
const Page = () => redirect("/intentions/perdir/saisie"); | ||
import {redirect} from 'next/navigation'; | ||
import {CODES_REGIONS_EXPE} from 'shared/security/securityUtils'; | ||
|
||
import {useAuth} from '@/utils/security/useAuth'; | ||
|
||
|
||
const Page = () => { | ||
const { auth } = useAuth(); | ||
const isPartOfExpe = CODES_REGIONS_EXPE.includes(auth?.user.codeRegion ?? ""); | ||
|
||
return isPartOfExpe ? redirect("/intentions/perdir/saisie") : redirect("/intentions/saisie"); | ||
}; | ||
export default Page; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,15 @@ | ||
import { GuardExpe } from "@/utils/security/GuardExpe"; | ||
import { GuardPermission } from "@/utils/security/GuardPermission"; | ||
|
||
import { PageClient } from "./page.client"; | ||
|
||
// eslint-disable-next-line import/no-anonymous-default-export, react/display-name | ||
export default () => { | ||
const SaisiePage = () => { | ||
return ( | ||
<GuardPermission permission="intentions-perdir/lecture"> | ||
<PageClient /> | ||
<GuardExpe isExpeRoute={true}> | ||
<PageClient /> | ||
</GuardExpe> | ||
</GuardPermission> | ||
); | ||
}; | ||
export default SaisiePage; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.