Prevent users from entering mixed case usernames

Booking pages are case insensitive new, so no more case sensitive
usernames.
This commit is contained in:
Alex van Andel committed 2021-06-23 16:10:58 +00:00
1 parent afa2e19f03
commit 1668785678
3 files changed
+496 -318

No files matched your search

+16 -4
View File
@@ -1,6 +1,6 @@
import React from "react";
export const UsernameInput = React.forwardRef( (props, ref) => (
const UsernameInput = React.forwardRef((props, ref) => (
// todo, check if username is already taken here?
<div>
<label htmlFor="username" className="block text-sm font-medium text-gray-700">
@@ -10,8 +10,20 @@ export const UsernameInput = React.forwardRef( (props, ref) => (
<span className="bg-gray-50 border border-r-0 border-gray-300 rounded-l-md px-3 inline-flex items-center text-gray-500 sm:text-sm">
{typeof window !== "undefined" && window.location.hostname}/
</span>
<input ref={ref} type="text" name="username" id="username" autoComplete="username" required {...props}
className="focus:ring-blue-500 focus:border-blue-500 flex-grow block w-full min-w-0 rounded-none rounded-r-md sm:text-sm border-gray-300"/>
<input
ref={ref}
type="text"
name="username"
id="username"
autoComplete="username"
required
{...props}
className="focus:ring-blue-500 focus:border-blue-500 flex-grow block w-full min-w-0 rounded-none rounded-r-md sm:text-sm border-gray-300 lowercase"
/>
</div>
</div>
));
));
UsernameInput.displayName = "UsernameInput";
export { UsernameInput };