-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Pinned typeorm version to work around issue nextauthjs/next-auth#833
- Loading branch information
Showing
6 changed files
with
426 additions
and
15 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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import React from "react"; | ||
import { useSession, signin, signout } from "next-auth/client"; | ||
|
||
export default function SignIn() { | ||
const [session, loading] = useSession(); | ||
|
||
return ( | ||
<p> | ||
{!session && ( | ||
<> | ||
Not signed in <br /> | ||
<button onClick={signin}>Sign in</button> | ||
</> | ||
)} | ||
{session && ( | ||
<> | ||
Signed in as {session.user.email} <br /> | ||
<button onClick={signout}>Sign out</button> | ||
</> | ||
)} | ||
</p> | ||
); | ||
} |
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,18 @@ | ||
import NextAuth from "next-auth"; | ||
import Providers from "next-auth/providers"; | ||
|
||
const options = { | ||
// Configure one or more authentication providers | ||
providers: [ | ||
Providers.Google({ | ||
clientId: process.env.GOOGLE_ID, | ||
clientSecret: process.env.GOOGLE_SECRET, | ||
}), | ||
// ...add more providers here | ||
], | ||
|
||
// A database is optional, but required to persist accounts in a database | ||
database: process.env.MONGODB_URI, | ||
}; | ||
|
||
export default (req, res) => NextAuth(req, res, options); |
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
Oops, something went wrong.