Skip to content

Commit

Permalink
chore: add ip to whitelist
Browse files Browse the repository at this point in the history
  • Loading branch information
jonat75 committed Jan 15, 2025
1 parent 4f8122c commit 77b8adc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .kontinuous/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ files:
# image: ghcr.io/socialgouv/docker/nginx:7.0.1
imagePackage: files
vars:
WHITELIST_IP: "94.23.250.213,37.187.27.197,37.187.137.149,217.182.225.117,217.182.225.113,217.182.142.112,51.38.59.32"
WHITELIST_IP: "94.23.250.213,37.187.27.197,37.187.137.149,217.182.225.117,217.182.225.113,217.182.142.112,51.38.59.32,51.254.44.90"
AUTH_PASSWD_FILE: /secrets/basic-auth.passwd
TRUSTED_PROXY_IP: "20.74.10.146"
FILES_PUBLIC: index-egalite-fh.xlsx,dgt-export-representation.xlsx
Expand Down
9 changes: 4 additions & 5 deletions packages/app/src/app/(default)/login/LoginRedirect.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
"use client";

import { type Session } from "next-auth";
import { redirect } from "next/navigation";
import { useEffect } from "react";

function getUriFromUrl(urlString: string): string {
Expand All @@ -16,22 +15,22 @@ function getUriFromUrl(urlString: string): string {
}

interface LoginRedirectProps {
session: Session | null;
callbackUrl: string;
session: Session | null;
}

export function LoginRedirect({ session, callbackUrl }: LoginRedirectProps) {
useEffect(() => {
if (callbackUrl) {
localStorage.setItem('egapro_callback_url', callbackUrl);
localStorage.setItem("egapro_callback_url", callbackUrl);
}
}, [callbackUrl]);

useEffect(() => {
if (session?.user) {
const savedCallbackUrl = localStorage.getItem('egapro_callback_url');
const savedCallbackUrl = localStorage.getItem("egapro_callback_url");
const redirectUrl = savedCallbackUrl ? getUriFromUrl(savedCallbackUrl) : "/";
localStorage.removeItem('egapro_callback_url');
localStorage.removeItem("egapro_callback_url");
window.location.href = redirectUrl;
}
}, [session?.user]);
Expand Down

0 comments on commit 77b8adc

Please sign in to comment.