From 7801ce67ace77f5de98ddc38d7b0b45c68faeb6b Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Tue, 3 Dec 2024 15:57:40 -0800 Subject: cache qrs --- src/routes/(app)/otpsecret/+server.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'src/routes/(app)/otpsecret') diff --git a/src/routes/(app)/otpsecret/+server.ts b/src/routes/(app)/otpsecret/+server.ts index 7226a7c9..c260b7da 100644 --- a/src/routes/(app)/otpsecret/+server.ts +++ b/src/routes/(app)/otpsecret/+server.ts @@ -1,5 +1,4 @@ import { auth, post } from "$lib/utils"; -import Qr from "qrcode-base64"; import { error } from "@sveltejs/kit"; export async function POST({ cookies, request }) { @@ -7,9 +6,7 @@ export async function POST({ cookies, request }) { const body = await request.json(); const { username, secret } = await post("/otpsecret", body, auth(cookies)); const uri = `otpauth://totp/coinos:${username}?secret=${secret}&period=30&digits=6&algorithm=SHA1&issuer=coinos`; - return new Response( - JSON.stringify({ secret, uri, qr: Qr.drawImg(uri, { size: 600 }) }), - ); + return new Response(JSON.stringify({ secret, uri })); } catch (e: any) { if (e.message.includes("pin")) throw e; error(500, "Problem saving secret"); -- cgit v1.2.3