diff --git a/apps/client/pages/api/auth/[...nextauth].ts b/apps/client/pages/api/auth/[...nextauth].ts
index 339eab48..ce370382 100644
--- a/apps/client/pages/api/auth/[...nextauth].ts
+++ b/apps/client/pages/api/auth/[...nextauth].ts
@@ -1,4 +1,4 @@
-import NextAuth from 'next-auth'
+import NextAuth, { type SessionStrategy } from 'next-auth'
import CredentialsProvider from 'next-auth/providers/credentials'
import { z } from 'zod'
import type { SharedType } from '@maybe-finance/shared'
@@ -23,6 +23,10 @@ export const authOptions = {
pages: {
signIn: '/login',
},
+ session: {
+ strategy: 'jwt' as SessionStrategy,
+ maxAge: 14 * 24 * 60 * 60, // 30 Days
+ },
providers: [
CredentialsProvider({
name: 'Credentials',
diff --git a/apps/client/pages/login.tsx b/apps/client/pages/login.tsx
index 4424c6f9..d6810c1f 100644
--- a/apps/client/pages/login.tsx
+++ b/apps/client/pages/login.tsx
@@ -27,7 +27,7 @@ export default function LoginPage() {
await signIn('credentials', {
email,
password,
- callbackUrl: '/',
+ redirect: false,
})
}
diff --git a/libs/client/features/src/layout/MenuPopover.tsx b/libs/client/features/src/layout/MenuPopover.tsx
index 7a1cbcd1..6413d08f 100644
--- a/libs/client/features/src/layout/MenuPopover.tsx
+++ b/libs/client/features/src/layout/MenuPopover.tsx
@@ -1,4 +1,4 @@
-import { useAuth0 } from '@auth0/auth0-react'
+import { signOut } from 'next-auth/react'
import { Menu } from '@maybe-finance/design-system'
import type { ComponentProps } from 'react'
import {
@@ -16,8 +16,6 @@ export function MenuPopover({
placement?: ComponentProps['placement']
isHeader: boolean
}) {
- const { logout } = useAuth0()
-
return (
- logout({ logoutParams: { returnTo: window.location.origin } })}
- />
+ signOut()} />
)