removed xbox
This commit is contained in:
parent
f615616a1e
commit
07b9ed9b98
3 changed files with 0 additions and 113 deletions
|
|
@ -1,34 +0,0 @@
|
|||
import { NextRequest, NextResponse } from "next/server";
|
||||
import { getAvatarProfile } from "@/lib/avatar";
|
||||
|
||||
export async function GET(req: NextRequest) {
|
||||
try {
|
||||
const { searchParams } = new URL(req.url);
|
||||
const gamertag = searchParams.get("gamertag");
|
||||
|
||||
if (!gamertag) {
|
||||
return NextResponse.json({ error: "no gamertag" }, { status: 400 });
|
||||
}
|
||||
|
||||
// Use the simple avatar service
|
||||
const result = await getAvatarProfile(gamertag);
|
||||
|
||||
return NextResponse.json(result);
|
||||
|
||||
} catch (error) {
|
||||
console.error("Failed to fetch Xbox profile:", error);
|
||||
|
||||
// Return fallback data on error
|
||||
const { searchParams } = new URL(req.url);
|
||||
const gamertag = searchParams.get("gamertag") || "Unknown";
|
||||
|
||||
return NextResponse.json(
|
||||
{
|
||||
gamertag,
|
||||
avatarUrl: "",
|
||||
error: "Failed to fetch profile data"
|
||||
},
|
||||
{ status: 500 }
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,37 +0,0 @@
|
|||
import { NextRequest, NextResponse } from "next/server";
|
||||
import { getXboxProfileWithAvatar } from "@/lib/xbox";
|
||||
|
||||
export async function GET(req: NextRequest) {
|
||||
try {
|
||||
const { searchParams } = new URL(req.url);
|
||||
const gamertag = searchParams.get("gamertag");
|
||||
|
||||
if (!gamertag) {
|
||||
return NextResponse.json(
|
||||
{ error: "Gamertag parameter is required" },
|
||||
{ status: 400 }
|
||||
);
|
||||
}
|
||||
|
||||
// Use the modified function that reads from environment variables
|
||||
const result = await getXboxProfileWithAvatar(gamertag);
|
||||
|
||||
return NextResponse.json(result);
|
||||
|
||||
} catch (error) {
|
||||
console.error("Failed to fetch Xbox profile:", error);
|
||||
|
||||
// Return fallback data on error
|
||||
const { searchParams } = new URL(req.url);
|
||||
const gamertag = searchParams.get("gamertag") || "Unknown";
|
||||
|
||||
return NextResponse.json(
|
||||
{
|
||||
gamertag,
|
||||
avatarUrl: "",
|
||||
error: "Failed to fetch profile data"
|
||||
},
|
||||
{ status: 500 }
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,42 +0,0 @@
|
|||
import { NextRequest, NextResponse } from "next/server";
|
||||
import XboxTokenManager from "@/lib/xbox-auth";
|
||||
|
||||
export async function GET() {
|
||||
try {
|
||||
const tokenManager = XboxTokenManager.getInstance();
|
||||
const status = tokenManager.getTokenStatus();
|
||||
|
||||
return NextResponse.json({
|
||||
status,
|
||||
message: status.valid ? "Tokens are valid" : "Tokens need refresh"
|
||||
});
|
||||
} catch (error) {
|
||||
console.error("Failed to get token status:", error);
|
||||
return NextResponse.json(
|
||||
{ error: "Failed to get token status" },
|
||||
{ status: 500 }
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export async function POST() {
|
||||
try {
|
||||
const tokenManager = XboxTokenManager.getInstance();
|
||||
const tokens = await tokenManager.forceRefresh();
|
||||
|
||||
return NextResponse.json({
|
||||
success: true,
|
||||
message: "Tokens refreshed successfully",
|
||||
expiresAt: tokens.expiresAt
|
||||
});
|
||||
} catch (error) {
|
||||
console.error("Failed to refresh tokens:", error);
|
||||
return NextResponse.json(
|
||||
{
|
||||
error: "Failed to refresh tokens",
|
||||
message: error instanceof Error ? error.message : "Unknown error"
|
||||
},
|
||||
{ status: 500 }
|
||||
);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue