-
Notifications
You must be signed in to change notification settings - Fork 13
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 #58 from celo-org/staging
Staging
- Loading branch information
Showing
18 changed files
with
296 additions
and
36 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
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
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,44 @@ | ||
import NextAuth, { AuthOptions, Profile, Session } from 'next-auth' | ||
import GithubProvider from 'next-auth/providers/github' | ||
|
||
type ExtendedProfile = { | ||
created_at?: string; | ||
} & Profile | ||
|
||
interface ExtendedUser { | ||
created_at?: string; | ||
name?: string | null; | ||
email?: string | null; | ||
image?: string | null; | ||
} | ||
|
||
type ExtendedSession = { | ||
user?: ExtendedUser; | ||
} & Session | ||
|
||
export const authOptions: AuthOptions = { | ||
providers: [ | ||
GithubProvider({ | ||
clientId: process.env.GITHUB_ID || '', | ||
clientSecret: process.env.GITHUB_SECRET || '', | ||
}) | ||
], | ||
callbacks: { | ||
async jwt({ token, profile }) { | ||
if (profile) { | ||
const extProfile: ExtendedProfile = profile | ||
token.user_created_at = extProfile.created_at | ||
} | ||
return token; | ||
}, | ||
async session({ session, token, user }) { | ||
const extSession: ExtendedSession = session; | ||
if (extSession.user) { | ||
extSession.user.created_at = token.user_created_at as string | ||
} | ||
return session; | ||
} | ||
} | ||
} | ||
|
||
export default NextAuth(authOptions) |
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
Oops, something went wrong.
39a6f16
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
faucet – ./
faucet-git-master-c-labs.vercel.app
faucet.celo.org
faucet-c-labs.vercel.app
faucet-clabs.vercel.app