Skip to content

Commit

Permalink
Update auth-options.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
Vyshnav001 authored Sep 29, 2024
1 parent 2d1c0e0 commit 10d76a1
Showing 1 changed file with 15 additions and 21 deletions.
36 changes: 15 additions & 21 deletions src/lib/auth-options.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
import {
DefaultSession,
type NextAuthOptions,
type Session as NextAuthSession,
} from "next-auth";
import { DefaultSession, type NextAuthOptions, type Session as NextAuthSession } from "next-auth";
import NextAuth from "next-auth/next";
import GoogleProvider from "next-auth/providers/google";
import { PrismaAdapter } from "@next-auth/prisma-adapter";
Expand All @@ -12,18 +8,18 @@ import { JWT } from "next-auth/jwt";
import { getUserById } from "@/app/actions/get-user-by-id";

declare module "next-auth" {
interface Session {
user: {
id: string;
role: UserRoleType;
} & DefaultSession["user"];
}
interface Session {
user: {
id: string;
role: UserRoleType;
} & DefaultSession["user"];
}
}

declare module "next-auth/jwt" {
interface JWT {
role: UserRoleType;
}
interface JWT {
role: UserRoleType;
}
}

export const authOptions: NextAuthOptions = {
Expand Down Expand Up @@ -64,15 +60,13 @@ export const authOptions: NextAuthOptions = {
},
};
},
};
},
},

session: {
strategy: "jwt",
},
secret: process.env.NEXTAUTH_SECRET,
// debug: process.env.NODE_ENV === "development",
session: {
strategy: "jwt",
},
secret: process.env.NEXTAUTH_SECRET,
// debug: process.env.NODE_ENV === "development",
};

export const handlers = NextAuth(authOptions);

0 comments on commit 10d76a1

Please sign in to comment.