diff options
Diffstat (limited to 'src/lib/auth/components/IsAuth.jsx')
| -rw-r--r-- | src/lib/auth/components/IsAuth.jsx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/auth/components/IsAuth.jsx b/src/lib/auth/components/IsAuth.jsx index 1cfd3172..a32e648c 100644 --- a/src/lib/auth/components/IsAuth.jsx +++ b/src/lib/auth/components/IsAuth.jsx @@ -7,8 +7,8 @@ const IsAuth = ({ children }) => { const [response, setResponse] = useState(<></>) useEffect(() => { - if (!getAuth()) { - router.replace('/login') + if (!getAuth() && router.pathname != '/login') { + router.replace(`/login?next=${router.asPath}`) } else { setResponse(children) } |
