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