Skip to content
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

fix: add privateRoute for redirection #2340

Merged
merged 1 commit into from
Jul 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 20 additions & 3 deletions packages/app/src/app/(default)/mon-espace/les-entreprises/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,12 @@ const MesEntreprisesPage = async ({ searchParams }: NextServerPageProps<never, "
<p>
<br />
Vous souhaitez rattacher votre adresse email à un autre Siren,{" "}
<Link target="_blank" href="https://app.moncomptepro.beta.gouv.fr/manage-organizations">
<Link
target="_blank"
href={`https://app${
config.api.security.moncomptepro.appTest ? "-sandbox" : ""
}.moncomptepro.beta.gouv.fr/manage-organizations`}
>
cliquez ici
</Link>
</p>
Expand All @@ -87,7 +92,12 @@ const MesEntreprisesPage = async ({ searchParams }: NextServerPageProps<never, "
<p>
<br />
Vous souhaitez rattacher votre adresse email à un autre Siren,{" "}
<Link target="_blank" href="https://app.moncomptepro.beta.gouv.fr/manage-organizations">
<Link
target="_blank"
href={`https://app${
config.api.security.moncomptepro.appTest ? "-sandbox" : ""
}.moncomptepro.beta.gouv.fr/manage-organizations`}
>
cliquez ici
</Link>
</p>
Expand All @@ -112,7 +122,14 @@ const MesEntreprisesPage = async ({ searchParams }: NextServerPageProps<never, "
<p>
<br />
Vous souhaitez rattacher votre adresse email à un autre Siren,{" "}
<Link href="https://app.moncomptepro.beta.gouv.fr/manage-organizations">cliquez ici</Link>
<Link
target="_blank"
href={`https://app${
config.api.security.moncomptepro.appTest ? "-sandbox" : ""
}.moncomptepro.beta.gouv.fr/manage-organizations`}
>
cliquez ici
</Link>
</p>
<Box mt="4w">Pas d'utilisateur pour ce Siren ou Url invalide</Box>
</Box>
Expand Down
3 changes: 3 additions & 0 deletions packages/app/src/common/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ export const config = {
secret: ensureApiEnvVar(process.env.SECURITY_JWT_SECRET, "secret"),
isEmailLogin: ensureApiEnvVar(process.env.EMAIL_LOGIN, isTruthy, false),
privateRoutes: [
"/mon-espace/mes-declarations",
"/mon-espace/les-entreprises",
"/mon-espace/mes-entreprises",
"/index-egapro/declaration/augmentations",
"/index-egapro/declaration/augmentations-et-promotions",
"/index-egapro/declaration/commencer",
Expand Down
Loading