Merge pull request #305 from HEPOSHEIKKI/main

Added QR code to TOTP setup
This commit is contained in:
Xylight authored and GitHub committed 2024-07-11 16:02:43 -07:00
commit 72a0aa799e
4 files changed
+13 -2

No files matched your search

BIN
View File
Binary file not shown.
+5 -1
View File
@@ -51,5 +51,9 @@
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch"
},
"type": "module"
"type": "module",
"dependencies": {
"@svelte-put/qr": "^1.2.1",
"install": "^0.13.0"
}
}
@@ -2,13 +2,14 @@
import { deleteProfile, profile, setUser } from '$lib/auth.js'
import { getClient, site } from '$lib/lemmy.js'
import { trycatch } from '$lib/util.js'
import { Button, Snippet, TextInput, toast } from 'mono-svelte'
import { Button, Material, Snippet, TextInput, toast } from 'mono-svelte'
import { instance as currentInstance } from '$lib/instance.js'
import { ClipboardDocument, Icon } from 'svelte-hero-icons'
import { goto } from '$app/navigation'
import { page } from '$app/stores'
import Switch from '$lib/components/input/Switch.svelte'
import { feature } from '$lib/version.js'
import { qr } from '@svelte-put/qr/svg'
import { t } from '$lib/translations.js'
import Header from '$lib/components/ui/layout/pages/Header.svelte'
@@ -127,6 +128,9 @@
</p>
{#if totpEnabled || totpLink}
{#if totpLink && !totpEnabled}
<Material color="transparent" class="!fill-white">
<svg use:qr={{ data: totpLink, logo: '/img/logo-isolated.svg' }} />
</Material>
<TextInput
disabled
type="password"
+3
View File
@@ -0,0 +1,3 @@
<svg fill="white" width="100" height="100" viewBox="15 15 70 70" xmlns="http://www.w3.org/2000/svg">
<path d="M45 20.8868C48.094 19.1004 51.906 19.1004 55 20.8868L72.7128 31.1132C75.8068 32.8996 77.7128 36.2008 77.7128 39.7735V60.2265C77.7128 63.7992 75.8068 67.1004 72.7128 68.8867L55 79.1133C51.906 80.8996 48.094 80.8996 45 79.1133L27.2872 68.8867C24.1932 67.1004 22.2872 63.7992 22.2872 60.2265V39.7735C22.2872 36.2008 24.1932 32.8996 27.2872 31.1132L45 20.8868Z"/>
</svg>

After

Width:  |  Height:  |  Size: 476 B