Skip to content

Commit

Permalink
save gh email to user table
Browse files Browse the repository at this point in the history
  • Loading branch information
thormengkheang committed Mar 14, 2024
1 parent 95187aa commit 444f3bb
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/app/login/github/callback/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@ export async function GET(request: Request): Promise<Response> {
const userId = generateId(15);
const authId = generateId(15);

await db.insert(user).values({ id: userId, name: githubUser.login });
await db
.insert(user)
.values({ id: userId, name: githubUser.login, email: githubUser.email });
await db.insert(user_oauth).values({
id: authId,
provider: "GITHUB",
Expand Down Expand Up @@ -106,4 +108,5 @@ export async function GET(request: Request): Promise<Response> {
interface GitHubUser {
id: string;
login: string;
email: string;
}

0 comments on commit 444f3bb

Please sign in to comment.