fix some lint errors

This commit is contained in:
Romulus21
2024-02-19 08:29:56 +01:00
parent ebfc56eba3
commit d99b94be55
7 changed files with 39 additions and 29 deletions

View File

@@ -27,9 +27,9 @@ export const AuthUserProvider = ({children}: PropsWithChildren) => {
try {
const res = await axios.get('/api/user')
setAuthUser(res.data)
} catch (e) {
// @ts-ignore
if (e.response.status === 401) {
} catch (error) {
// @ts-expect-error 401 error to redirect
if (error.response.status === 401) {
console.info('no user login')
if (!['/connexion', '/inscription'].includes(window.location.pathname)) {
window.location.href = '/connexion'