Skip to content

Commit 98eb819

Browse files
committed
fix: formutted
1 parent 48d2e80 commit 98eb819

File tree

1 file changed

+8
-12
lines changed
  • apps/dashboard/app/api/integrations/vercel/callback

1 file changed

+8
-12
lines changed

apps/dashboard/app/api/integrations/vercel/callback/route.ts

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export async function GET(request: NextRequest) {
5656

5757
const userResponse_json = await userResponse.json();
5858
const userInfo = userResponse_json.user;
59-
59+
6060
if (!userInfo.email || !userInfo.id) {
6161
return NextResponse.redirect(
6262
`${process.env.BETTER_AUTH_URL}/auth/error?error=invalid_user_info`
@@ -74,7 +74,7 @@ export async function GET(request: NextRequest) {
7474
} else {
7575
const newUserId = randomUUID();
7676
const now = new Date().toISOString();
77-
77+
7878
await db.execute(sql`
7979
INSERT INTO "user" (
8080
id, name, email, email_verified, image, created_at, updated_at
@@ -88,16 +88,12 @@ export async function GET(request: NextRequest) {
8888
${now}
8989
)
9090
`);
91-
91+
9292
userId = newUserId;
9393
}
9494

95-
9695
const existingAccount = await db.query.account.findFirst({
97-
where: and(
98-
eq(account.userId, userId),
99-
eq(account.providerId, 'vercel')
100-
),
96+
where: and(eq(account.userId, userId), eq(account.providerId, 'vercel')),
10197
});
10298

10399
const now = new Date();
@@ -117,7 +113,6 @@ export async function GET(request: NextRequest) {
117113
updatedAt: now.toISOString(),
118114
};
119115

120-
121116
if (existingAccount) {
122117
await db.execute(sql`
123118
UPDATE "account" SET
@@ -143,12 +138,13 @@ export async function GET(request: NextRequest) {
143138
`);
144139
}
145140

146-
const redirectUrl = next || `${process.env.BETTER_AUTH_URL}/dashboard?vercel_integrated=true`;
147-
141+
const redirectUrl =
142+
next || `${process.env.BETTER_AUTH_URL}/dashboard?vercel_integrated=true`;
143+
148144
return NextResponse.redirect(redirectUrl);
149145
} catch (error) {
150146
return NextResponse.redirect(
151147
`${process.env.BETTER_AUTH_URL}/auth/error?error=internal_error`
152148
);
153149
}
154-
}
150+
}

0 commit comments

Comments
 (0)