fix some lint errors
This commit is contained in:
@@ -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'
|
||||
|
||||
Reference in New Issue
Block a user