Skip to content

Commit

Permalink
토큰을 가져오지 못하는 오류 해결
Browse files Browse the repository at this point in the history
  • Loading branch information
ipcgrdn committed Nov 27, 2024
1 parent 4d9760f commit 77c3d6e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
12 changes: 1 addition & 11 deletions src/app/api/logout/route.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { cookies } from "next/headers";
import { NextResponse } from "next/server";

export async function POST() {
Expand All @@ -10,13 +9,4 @@ export async function POST() {
},
}
);
}

export async function GET() {
const cookieStore = cookies();
const token = cookieStore.get("access_token");

return NextResponse.json({
token: token?.value || null,
});
}
}
12 changes: 12 additions & 0 deletions src/app/api/token/route.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { cookies } from "next/headers";
import { NextResponse } from "next/server";

export async function GET() {
const cookieStore = cookies();
const token = cookieStore.get("access_token");

return NextResponse.json({
token: token?.value || null,
});
}

0 comments on commit 77c3d6e

Please sign in to comment.