Skip to content

Commit

Permalink
⚗️ testing
Browse files Browse the repository at this point in the history
  • Loading branch information
JulianNymark committed Mar 15, 2024
1 parent 205992d commit dba4395
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions aksel.nav.no/website/components/auth/useAuth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,17 @@ export const useAuth = () => {
const router = useRouter();

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

const logout = async () => {
Expand Down

0 comments on commit dba4395

Please sign in to comment.