diff options
| author | Rafi Zadanly <zadanlyr@gmail.com> | 2023-03-29 14:29:29 +0700 |
|---|---|---|
| committer | Rafi Zadanly <zadanlyr@gmail.com> | 2023-03-29 14:29:29 +0700 |
| commit | 1d606fe88f97f87e32a58b1b187a71f40c70169c (patch) | |
| tree | 3045839e7e9362f1b851d182614f6ed3ae04af80 /src/lib/auth/components | |
| parent | ac230a35f325cc47e89fd5d635847536f2dd9b44 (diff) | |
blog detail
Diffstat (limited to 'src/lib/auth/components')
| -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) } |
