This commit is contained in:
2025-07-01 10:51:57 +09:00
90 changed files with 4706 additions and 2209 deletions
@@ -1,2 +0,0 @@
import { LoginlogPage } from "@/pages/loginlog";
export default LoginlogPage;
+17
View File
@@ -0,0 +1,17 @@
import { cookies } from "next/headers";
import { NextResponse } from "next/server";
import {
ACCESS_TOKEN,
AUTH_USER_ID,
CLAIM_NAME,
REFRESH_TOKEN,
} from "@/shared/config";
export async function POST() {
const cookieStore = await cookies();
cookieStore.delete(ACCESS_TOKEN);
cookieStore.delete(REFRESH_TOKEN);
cookieStore.delete(AUTH_USER_ID);
cookieStore.delete(CLAIM_NAME);
return NextResponse.json({ message: "Logged out" }, { status: 200 });
}
-16
View File
@@ -1,16 +0,0 @@
import { NextRequest, NextResponse } from "next/server";
export async function GET(request: NextRequest) {
const ipAddress =
request.headers.get("x-forwarded-for")?.split(",")[0] || "unknown";
const ipv4Regex = /^::ffff:(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})$/;
const match = ipAddress.match(ipv4Regex);
const normalizedIp = match ? match[1] : ipAddress;
return NextResponse.json({
originalIp: ipAddress,
normalizedIp: normalizedIp,
});
}