Skip to content

Commit ab1b179

Browse files
committed
test
1 parent 12cc79b commit ab1b179

File tree

6 files changed

+39
-6
lines changed

6 files changed

+39
-6
lines changed

src/frontend/apps/impress/src/features/auth/components/Auth.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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;
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { baseApiUrl } from '@/api';
22

3-
export const HOME_URL = '/home';
3+
export const HOME_URL = '/home/';
44
export const LOGIN_URL = `${baseApiUrl()}authenticate/`;
55
export const LOGOUT_URL = `${baseApiUrl()}logout/`;
66
export const PATH_AUTH_LOCAL_STORAGE = 'docs-path-auth';
Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
1-
import { useRouter } from 'next/router';
2-
31
import { HOME_URL } from '@/features/auth';
42

53
const Page = () => {
6-
const { replace } = useRouter();
7-
void replace(HOME_URL);
4+
window.location.replace(HOME_URL);
85
};
96

107
export default Page;

src/helm/env.d/feature/values.impress.yaml.gotmpl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff 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:
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
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 }}

src/helm/impress/values.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff 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

491502
posthog:

0 commit comments

Comments
 (0)