Skip to content

Commit 92f58d8

Browse files
authored
feat: remove space and @ from user input atproto handle (#1137)
1 parent 4aceb9c commit 92f58d8

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

app/components/Header/AuthModal.client.vue

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,19 @@ async function handleLogin() {
2525
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)