diff options
| author | HATEC\SPVDEV001 <tri.susilo@altama.co.id> | 2023-10-16 11:28:34 +0700 |
|---|---|---|
| committer | HATEC\SPVDEV001 <tri.susilo@altama.co.id> | 2023-10-16 11:28:34 +0700 |
| commit | 954be13467b02889414db600fee8e8b7b76cc2aa (patch) | |
| tree | 4331a21338b2ac33b6f7a2911e61365b8950c33c /src/lib/auth | |
| parent | ca445ab4e089b98fb67b004a6cb4a8968f471ae4 (diff) | |
| parent | 6aa5fa70cf5ccd2825e5657ec1a90e370dea3bcf (diff) | |
Merge branch 'CR/UI' of https://bitbucket.org/altafixco/next-indoteknik into CR/UI
Diffstat (limited to 'src/lib/auth')
| -rw-r--r-- | src/lib/auth/components/IsAuth.jsx | 2 | ||||
| -rw-r--r-- | src/lib/auth/hooks/useLogin.js | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/auth/components/IsAuth.jsx b/src/lib/auth/components/IsAuth.jsx index a32e648c..1948ae0c 100644 --- a/src/lib/auth/components/IsAuth.jsx +++ b/src/lib/auth/components/IsAuth.jsx @@ -8,7 +8,7 @@ const IsAuth = ({ children }) => { useEffect(() => { if (!getAuth() && router.pathname != '/login') { - router.replace(`/login?next=${router.asPath}`) + router.replace(`/login?next=${encodeURIComponent(router.asPath)}`) } else { setResponse(children) } diff --git a/src/lib/auth/hooks/useLogin.js b/src/lib/auth/hooks/useLogin.js index 34605614..17731a86 100644 --- a/src/lib/auth/hooks/useLogin.js +++ b/src/lib/auth/hooks/useLogin.js @@ -71,7 +71,7 @@ const useLogin = () => { if (data.isAuth) { session.odooUser = data.user setCookie('auth', JSON.stringify(session?.odooUser)) - router.push(router?.query?.next ?? '/') + router.push(decodeURIComponent(router?.query?.next) ?? '/') return } } |
