File tree Expand file tree Collapse file tree 6 files changed +39
-6
lines changed
frontend/apps/impress/src Expand file tree Collapse file tree 6 files changed +39
-6
lines changed Original file line number Diff line number Diff line change @@ -44,7 +44,7 @@ export const Auth = ({ children }: PropsWithChildren) => {
4444 if ( config ?. FRONTEND_HOMEPAGE_FEATURE_ENABLED ) {
4545 if ( pathname !== HOME_URL ) {
4646 setIsRedirecting ( true ) ;
47- void replace ( HOME_URL ) . then ( ( ) => setIsRedirecting ( false ) ) ;
47+ window . location . replace ( HOME_URL ) ;
4848 }
4949
5050 return ;
Original file line number Diff line number Diff line change 11import { baseApiUrl } from '@/api' ;
22
3- export const HOME_URL = '/home' ;
3+ export const HOME_URL = '/home/ ' ;
44export const LOGIN_URL = `${ baseApiUrl ( ) } authenticate/` ;
55export const LOGOUT_URL = `${ baseApiUrl ( ) } logout/` ;
66export const PATH_AUTH_LOCAL_STORAGE = 'docs-path-auth' ;
Original file line number Diff line number Diff line change 1- import { useRouter } from 'next/router' ;
2-
31import { HOME_URL } from '@/features/auth' ;
42
53const Page = ( ) => {
6- const { replace } = useRouter ( ) ;
7- void replace ( HOME_URL ) ;
4+ window . location . replace ( HOME_URL ) ;
85} ;
96
107export default Page ;
Original file line number Diff line number Diff line change @@ -119,6 +119,13 @@ frontend:
119119 PORT: 8080
120120 NEXT_PUBLIC_API_ORIGIN: https://{{ .Values.feature }}-docs.{{ .Values.domain }}
121121
122+ nginxConfig:
123+ enabled: true
124+ redirectLanding:
125+ enabled: true
126+ locationUrl: /home
127+ redirectionUrl: https://lasuite.numerique.gouv.fr/produits/docs
128+
122129 replicas: 1
123130
124131 image:
Original file line number Diff line number Diff line change 1+ {{- if .Values.frontend.nginxConfig.enabled }}
2+ apiVersion : v1
3+ kind : ConfigMap
4+ metadata :
5+ name : {{ include "impress.frontend.fullname" . }}-nginx-config
6+ namespace : {{ .Release.Namespace | quote }}
7+ labels :
8+ {{- include "impress.common.labels" (list . "frontend") | nindent 4 }}
9+ data :
10+ default.conf : |
11+ server {
12+ {{- if .Values.frontend.nginxConfig.redirectLanding.enabled }}
13+ location ~ ^{{ .Values.frontend.nginxConfig.redirectLanding.locationUrl }}\/?$ {
14+ return 301 {{ .Values.frontend.nginxConfig.redirectLanding.redirectionUrl }};
15+ }
16+ {{- end }}
17+ }
18+ {{- end }}
Original file line number Diff line number Diff line change @@ -486,6 +486,17 @@ frontend:
486486 # # @param frontend.serviceAccountName Optional service account name to use for frontend pods
487487 serviceAccountName : null
488488
489+ # # @param frontend.nginxConfig.enabled Enable nginx configuration override via ConfigMap
490+ # # @param frontend.nginxConfig.redirectLanding.enabled Enable home redirect in nginx configuration
491+ # # @param frontend.nginxConfig.redirectLanding.locationUrl URL path to redirect from (e.g., /home)
492+ # # @param frontend.nginxConfig.redirectLanding.redirectionUrl Full URL to redirect to
493+ nginxConfig :
494+ enabled : false
495+ redirectLanding :
496+ enabled : false
497+ locationUrl : " "
498+ redirectionUrl : " "
499+
489500# # @section posthog
490501
491502posthog :
You can’t perform that action at this time.
0 commit comments