Skip to content

Commit

Permalink
feat: add google identity provider to auth api
Browse files Browse the repository at this point in the history
  • Loading branch information
subfuzion committed Mar 9, 2023
1 parent 05d1278 commit d5e0841
Show file tree
Hide file tree
Showing 3 changed files with 139 additions and 3 deletions.
124 changes: 121 additions & 3 deletions app/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"dependencies": {
"@google-cloud/firestore": "^6.5.0",
"next": "13.2.2",
"next-auth": "^4.20.1",
"react": "18.2.0",
"react-dom": "18.2.0"
},
Expand Down
17 changes: 17 additions & 0 deletions app/src/pages/api/auth/[...nextauth].ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import NextAuth from 'next-auth';
import GoogleProvider from 'next-auth/providers/google';
import assert from 'node:assert';

assert(process.env.GOOGLE_CLIENT_ID);
assert(process.env.GOOGLE_CLIENT_SECRET);

export const authOptions = {
providers: [
GoogleProvider({
clientId: process.env.GOOGLE_CLIENT_ID,
clientSecret: process.env.GOOGLE_CLIENT_SECRET,
}),
],
};

export default NextAuth(authOptions);

0 comments on commit d5e0841

Please sign in to comment.