diff --git a/lib/auth/constants.ts b/lib/auth/constants.ts index 840a0cb2..362344e5 100644 --- a/lib/auth/constants.ts +++ b/lib/auth/constants.ts @@ -39,9 +39,13 @@ export const authOptions: AuthOptions = { }, }, callbacks: { - // async signIn() { - - // }, + async signIn() { + // extra sign-in checks + return true; + }, + async redirect({ url, baseUrl }) { + return url.startsWith(baseUrl) ? Promise.resolve(url) : Promise.resolve(baseUrl); + }, async jwt({ user, token }) { if (user) { // Note that this if condition is needed @@ -60,8 +64,8 @@ export const authOptions: AuthOptions = { pages: { signIn: '/signin', signOut: '/', - // error: '/api/rm/v0/auth/error', // Error code passed in query string as ?error= - // verifyRequest: '/api/rm/v0/auth/verify-request', // (used for check email message) + error: '/error', // Error code passed in query string as ?error= + verifyRequest: '/verify', // (used for check email message) // newUser: '/' // New users will be directed here on first sign in (leave the property out if not of interest) }, }; diff --git a/src/app/api/auth/[...nextauth]/route.ts b/src/app/api/auth/[...nextauth]/route.ts index 513940c3..a80e93db 100644 --- a/src/app/api/auth/[...nextauth]/route.ts +++ b/src/app/api/auth/[...nextauth]/route.ts @@ -1,5 +1,4 @@ // api/auth/route.ts simple poc - // [...nextauth].ts// auth.ts TS-Doc? import NextAuth from 'next-auth'; import { finalAuth } from '@auth/adapter'; diff --git a/src/app/components/client/signup-view.tsx b/src/app/components/client/signup-view.tsx index e89b4f09..cc1174ec 100644 --- a/src/app/components/client/signup-view.tsx +++ b/src/app/components/client/signup-view.tsx @@ -91,6 +91,7 @@ export const VSignUp = ({ providers, user, csrf }: VSignUpProps) => {