Skip to content

Commit 3d49935

Browse files
committed
.
1 parent 3936783 commit 3d49935

File tree

1 file changed

+3
-3
lines changed
  • apps/website/app/api/access-token

1 file changed

+3
-3
lines changed

apps/website/app/api/access-token/route.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export const POST = async (request: Request) => {
3232

3333
// const { data, error } = await query;
3434

35-
const data = [{ "access-token": "dummy data" }];
35+
const data = { "access-token": "dummy data" };
3636
const error = null;
3737

3838
if (error) {
@@ -42,14 +42,14 @@ export const POST = async (request: Request) => {
4242
);
4343
}
4444

45-
if (!data || data.length === 0) {
45+
if (!data) {
4646
return NextResponse.json(
4747
{ error: "No access token found" },
4848
{ status: 404 },
4949
);
5050
}
5151

52-
return NextResponse.json({ accessToken: data[0]["access-token"] });
52+
return NextResponse.json({ accessToken: data["access-token"] });
5353
} catch (error) {
5454
if (error instanceof z.ZodError) {
5555
return NextResponse.json(

0 commit comments

Comments
 (0)