Skip to content

Commit 393cd83

Browse files
committed
fix: better handle normalization
1 parent cc1481a commit 393cd83

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

app/components/Header/AuthModal.client.vue

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,22 @@ async function handleCreateAccount() {
2222
2323
async function handleLogin() {
2424
if (handleInput.value) {
25-
await authRedirect(handleInput.value.trim().replace('@', ''))
25+
await authRedirect(handleInput.value)
2626
}
2727
}
28+
29+
watch(handleInput, newHandleInput => {
30+
if (!newHandleInput) return
31+
32+
const normalized = newHandleInput
33+
.trim()
34+
.toLowerCase()
35+
.replace(/[^a-z0-9.-]/g, '')
36+
37+
if (normalized !== newHandleInput) {
38+
handleInput.value = normalized
39+
}
40+
})
2841
</script>
2942

3043
<template>

0 commit comments

Comments
 (0)