Skip to content

Commit

Permalink
remove unused /user/breaches API GET endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
rhelmer committed Oct 31, 2024
1 parent c14d719 commit 5fd3114
Showing 1 changed file with 0 additions and 23 deletions.
23 changes: 0 additions & 23 deletions src/app/api/v1/user/breaches/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,29 +20,6 @@ export interface BreachResolutionRequest {
resolutionsChecked: Array<HibpBreachDataTypes[keyof HibpBreachDataTypes]>;
}

// Get breaches data
export async function GET(req: NextRequest) {
const token = await getToken({ req });
if (typeof token?.subscriber?.fxa_uid === "string") {
// Signed in
try {
const subscriber = await getSubscriberByFxaUid(token.subscriber?.fxa_uid);
const allBreaches = await getBreaches();
const breaches = await getAllEmailsAndBreaches(subscriber, allBreaches);
const successResponse = {
success: true,
breaches,
};
return NextResponse.json(successResponse);
} catch (e) {
logger.error(e);
return NextResponse.json({ success: false }, { status: 500 });
}
} else {
return NextResponse.json({ success: false }, { status: 401 });
}
}

export async function PUT(req: NextRequest) {
const token = await getToken({ req });
if (typeof token?.subscriber?.fxa_uid === "string") {
Expand Down

0 comments on commit 5fd3114

Please sign in to comment.