-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #185 from rit-sse/nextauth-type-fix
Fixed nextauth typeerror and removed some unused imports. Build works now
- Loading branch information
Showing
7 changed files
with
37 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,7 @@ | ||
import { PrismaAdapter } from "@auth/prisma-adapter"; | ||
import { PrismaClient } from "@prisma/client"; | ||
import NextAuth, { AuthOptions } from "next-auth"; | ||
import GoogleProvider from "next-auth/providers/google"; | ||
import { authOptions } from "@/lib/authOptions"; | ||
import NextAuth from "next-auth"; | ||
|
||
const prisma = new PrismaClient(); | ||
|
||
export const authOptions: AuthOptions = { | ||
adapter: PrismaAdapter(prisma), | ||
providers: [ | ||
GoogleProvider({ | ||
clientId: process.env.GOOGLE_CLIENT_ID || "", | ||
clientSecret: process.env.GOOGLE_CLIENT_SECRET || "", | ||
authorization: { | ||
params: { | ||
hd: "g.rit.edu", // restrict logins to rit.edu accounts | ||
}, | ||
}, | ||
}), | ||
], | ||
}; | ||
|
||
export const handler = NextAuth(authOptions); | ||
const handler = NextAuth(authOptions); | ||
|
||
export { handler as GET, handler as POST }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { PrismaAdapter } from "@next-auth/prisma-adapter"; | ||
import { PrismaClient } from "@prisma/client"; | ||
import { AuthOptions } from "next-auth"; | ||
import GoogleProvider from "next-auth/providers/google"; | ||
|
||
const prisma = new PrismaClient(); | ||
|
||
export const authOptions: AuthOptions = { | ||
adapter: PrismaAdapter(prisma), | ||
providers: [ | ||
GoogleProvider({ | ||
clientId: process.env.GOOGLE_CLIENT_ID || "", | ||
clientSecret: process.env.GOOGLE_CLIENT_SECRET || "", | ||
authorization: { | ||
params: { | ||
hd: "g.rit.edu", // restrict logins to rit.edu accounts | ||
}, | ||
}, | ||
}), | ||
], | ||
}; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters