Skip to content

Commit

Permalink
⚗️ test encoding uri for anchor (redirect)
Browse files Browse the repository at this point in the history
  • Loading branch information
JulianNymark committed Mar 15, 2024
1 parent 495d22a commit 15c7c9e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion aksel.nav.no/website/components/auth/useAuth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ export const useAuth = () => {
const router = useRouter();

const login = async (anchor = "") => {
router.push(`/oauth2/login?redirect=${router.asPath}${anchor}`, undefined, {
console.log({ anchor });
const redirect = encodeURIComponent(router.asPath + anchor);
router.push(`/oauth2/login?redirect=${redirect}`, undefined, {
shallow: true,
});
};
Expand Down

0 comments on commit 15c7c9e

Please sign in to comment.