Skip to content

Commit

Permalink
rm u2f set cmp
Browse files Browse the repository at this point in the history
  • Loading branch information
peintnermax committed Apr 24, 2024
1 parent 430d87c commit 6622288
Showing 1 changed file with 1 addition and 18 deletions.
19 changes: 1 addition & 18 deletions apps/login/app/(login)/u2f/set/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,27 +18,10 @@ export default async function Page({
params: Record<string | number | symbol, string | undefined>;
}) {
const { loginName, organization } = searchParams;
const { method } = params;

const branding = await getBrandingSettings(server, organization);

const totpResponse = await loadSession(loginName, organization).then(
({ session, token }) => {
if (session && session.factors?.user?.id) {
if (method === "time-based") {
return registerTOTP(session.factors.user.id, token);
} else if (method === "sms") {
return addOTPSMS(session.factors.user.id);
} else if (method === "email") {
return addOTPEmail(session.factors.user.id);
} else {
throw new Error("Invalid method");
}
} else {
throw new Error("No session found");
}
}
);
const totpResponse = await loadSession(loginName, organization).then();

async function loadSession(loginName?: string, organization?: string) {
const recent = await getMostRecentCookieWithLoginname(
Expand Down

0 comments on commit 6622288

Please sign in to comment.