Skip to content

Commit 199a3e5

Browse files
revert linting
1 parent fcdb636 commit 199a3e5

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { useCheckAuth } from "ra-core";
2-
import { useEffect } from "react";
3-
import { To, useNavigate } from "react-router";
1+
import { useCheckAuth } from 'ra-core';
2+
import { useEffect } from 'react';
3+
import { To, useNavigate } from 'react-router';
44

55
/**
66
* This hook redirect the user to the provided path (/ by default) if they are authenticated.
@@ -13,21 +13,21 @@ import { To, useNavigate } from "react-router";
1313
* }
1414
**/
1515
export const useRedirectIfAuthenticated = (
16-
redirectTo: UseRedirectIfAuthenticatedOptions = "/"
16+
redirectTo: UseRedirectIfAuthenticatedOptions = '/'
1717
) => {
18-
const navigate = useNavigate();
19-
const checkAuth = useCheckAuth();
18+
const navigate = useNavigate();
19+
const checkAuth = useCheckAuth();
2020

21-
useEffect(() => {
22-
checkAuth({}, false, undefined, true)
23-
.then(() => {
24-
// already authenticated, redirect to the home page
25-
navigate(redirectTo);
26-
})
27-
.catch(() => {
28-
// not authenticated, stay on the login page
29-
});
30-
}, [checkAuth, navigate, redirectTo]);
21+
useEffect(() => {
22+
checkAuth({}, false, undefined, true)
23+
.then(() => {
24+
// already authenticated, redirect to the home page
25+
navigate(redirectTo);
26+
})
27+
.catch(() => {
28+
// not authenticated, stay on the login page
29+
});
30+
}, [checkAuth, navigate, redirectTo]);
3131
};
3232

3333
export type UseRedirectIfAuthenticatedOptions = To;

0 commit comments

Comments
 (0)