From 10385e3483052144ce0a8614a0e05d005b746d72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Pailharey?= <rpailharey@grandlyon.com> Date: Tue, 25 Apr 2023 10:08:21 +0200 Subject: [PATCH] use links from router --- src/hooks/useAuth.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/hooks/useAuth.ts b/src/hooks/useAuth.ts index 11b8270e..f7df8af3 100644 --- a/src/hooks/useAuth.ts +++ b/src/hooks/useAuth.ts @@ -2,6 +2,7 @@ import { useContext, useState } from 'react' import axios from 'axios' import { UserContext } from './userContext' import { useHistory } from 'react-router-dom' +import { links } from '../components/Routes/Router' export interface Auth { loginUser: () => Promise<void> @@ -38,7 +39,7 @@ export const useAuth = (): Auth => { const { data } = await axios.get(`/api/common/WhoAmI`) if (data && setUser) { setUser(data) - history.push('/editing') + history.push(links.newsletter.path) } } catch (e) { setError(e) -- GitLab