Lowercase email on submisison
This commit is contained in:
parent
8c630ada1f
commit
07fdd0a9d4
|
@ -126,7 +126,8 @@ export function AccountForm(props) {
|
|||
const handleSubmit = (e) => {
|
||||
if (loading) return;
|
||||
setLoading(true);
|
||||
requester('/members/' + member.id + '/', 'PATCH', token, input)
|
||||
const data = { ...input, email: input.email.toLowerCase() };
|
||||
requester('/members/' + member.id + '/', 'PATCH', token, data)
|
||||
.then(res => {
|
||||
setError({});
|
||||
refreshUser();
|
||||
|
|
|
@ -413,7 +413,8 @@ export function AdminMemberForm(props) {
|
|||
if (loading) return;
|
||||
setLoading(true);
|
||||
setSuccess(false);
|
||||
requester('/members/' + id + '/', 'PATCH', token, input)
|
||||
const data = { ...input, email: input.email.toLowerCase() };
|
||||
requester('/members/' + id + '/', 'PATCH', token, data)
|
||||
.then(res => {
|
||||
setLoading(false);
|
||||
setSuccess(true);
|
||||
|
|
|
@ -54,7 +54,7 @@ export function LoginForm(props) {
|
|||
};
|
||||
|
||||
export function SignupForm(props) {
|
||||
const [input, setInput] = useState({});
|
||||
const [input, setInput] = useState({ email: '' });
|
||||
const [error, setError] = useState({});
|
||||
const [loading, setLoading] = useState(false);
|
||||
|
||||
|
@ -72,7 +72,8 @@ export function SignupForm(props) {
|
|||
if (loading) return;
|
||||
setLoading(true);
|
||||
input.username = genUsername();
|
||||
requester('/registration/', 'POST', '', input)
|
||||
const data = { ...input, email: input.email.toLowerCase() };
|
||||
requester('/registration/', 'POST', '', data)
|
||||
.then(res => {
|
||||
setError({});
|
||||
props.setTokenCache(res.key);
|
||||
|
|
Loading…
Reference in New Issue
Block a user