diff options
| author | Adam Soltys <[email protected]> | 2024-12-03 15:57:40 -0800 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2024-12-03 16:46:25 -0800 |
| commit | 7801ce67ace77f5de98ddc38d7b0b45c68faeb6b (patch) | |
| tree | 64e3d8db8173db04e2181c3ddb33ef1a2406f301 /src/routes/(app)/otpsecret | |
| parent | 2b174ad557e82731e59ff47e705af085071f7132 (diff) | |
| download | coinos-ui-7801ce67ace77f5de98ddc38d7b0b45c68faeb6b.tar.gz coinos-ui-7801ce67ace77f5de98ddc38d7b0b45c68faeb6b.zip | |
cache qrs
Diffstat (limited to 'src/routes/(app)/otpsecret')
| -rw-r--r-- | src/routes/(app)/otpsecret/+server.ts | 5 |
1 files changed, 1 insertions, 4 deletions
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"); |
