mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-12 22:26:08 -04:00
feat(frontend): handle username in lowercase
When handling usernames for login and registering with local or permissions, this makes sure that the username is always in lowercase. Signed-off-by: Philip Molares <philip.molares@udo.edu> Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
parent
0a8945d934
commit
e13055736a
9 changed files with 95 additions and 15 deletions
|
@ -17,6 +17,7 @@ import { useUiNotifications } from '../components/notifications/ui-notification-
|
|||
import { RegisterError } from '../components/register-page/register-error'
|
||||
import { RegisterInfos } from '../components/register-page/register-infos'
|
||||
import { useApplicationState } from '../hooks/common/use-application-state'
|
||||
import { useLowercaseOnInputChange } from '../hooks/common/use-lowercase-on-input-change'
|
||||
import { useOnInputChange } from '../hooks/common/use-on-input-change'
|
||||
import type { NextPage } from 'next'
|
||||
import { useRouter } from 'next/router'
|
||||
|
@ -62,7 +63,7 @@ export const RegisterPage: NextPage = () => {
|
|||
return error?.backendErrorName === 'PasswordTooWeakError'
|
||||
}, [error])
|
||||
|
||||
const onUsernameChange = useOnInputChange(setUsername)
|
||||
const onUsernameChange = useLowercaseOnInputChange(setUsername)
|
||||
const onDisplayNameChange = useOnInputChange(setDisplayName)
|
||||
const onPasswordChange = useOnInputChange(setPassword)
|
||||
const onPasswordAgainChange = useOnInputChange(setPasswordAgain)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue