Spaces:
Sleeping
Sleeping
Commit ·
e19cdf4
1
Parent(s): 86c1aaf
apply changes
Browse files
src/app/api/auth/github/callback/route.ts
CHANGED
|
@@ -57,8 +57,18 @@ export async function GET(request: NextRequest) {
|
|
| 57 |
const githubUser = await userResponse.json();
|
| 58 |
|
| 59 |
// Check if user exists
|
|
|
|
| 60 |
const existingUsers = await db
|
| 61 |
-
.select(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 62 |
.from(users)
|
| 63 |
.where(eq(users.githubId, githubUser.id))
|
| 64 |
.limit(1);
|
|
|
|
| 57 |
const githubUser = await userResponse.json();
|
| 58 |
|
| 59 |
// Check if user exists
|
| 60 |
+
// TODO: After Turso migration, add syncStatus, lastSyncAt, syncError to this select
|
| 61 |
const existingUsers = await db
|
| 62 |
+
.select({
|
| 63 |
+
id: users.id,
|
| 64 |
+
githubId: users.githubId,
|
| 65 |
+
username: users.username,
|
| 66 |
+
avatarUrl: users.avatarUrl,
|
| 67 |
+
role: users.role,
|
| 68 |
+
githubAccessToken: users.githubAccessToken,
|
| 69 |
+
createdAt: users.createdAt,
|
| 70 |
+
updatedAt: users.updatedAt,
|
| 71 |
+
})
|
| 72 |
.from(users)
|
| 73 |
.where(eq(users.githubId, githubUser.id))
|
| 74 |
.limit(1);
|