fix(frontend): 🐛 checkbox value in form is not a boolean

This commit is contained in:
Julien Oculi 2024-06-19 17:31:35 +02:00
parent 22a6ffc4fb
commit 3bf4083a10
2 changed files with 4 additions and 3 deletions

View file

@ -35,7 +35,8 @@
"pwa", "pwa",
"api", "api",
"ux", "ux",
"route" "route",
"frontend"
], ],
"[ignore]": { "[ignore]": {
"editor.defaultFormatter": "foxundermoon.shell-format" "editor.defaultFormatter": "foxundermoon.shell-format"

View file

@ -35,7 +35,7 @@ export default function LoginForm() {
type LoginFormFields = { type LoginFormFields = {
email: string email: string
passkey: boolean passkey: 'on' | undefined
} }
async function connect(event: Event) { async function connect(event: Event) {
@ -46,7 +46,7 @@ async function connect(event: Event) {
try { try {
// User disable passkey // User disable passkey
if (!fields.passkey) { if (fields.passkey !== 'on') {
throw new Error('User refused passkey') throw new Error('User refused passkey')
} }