usernames: enforce lowercase

This commit is contained in:
@wwwjim 2020-08-06 13:01:05 -07:00
parent 6e0f82d99b
commit 47066916fa
3 changed files with 5 additions and 3 deletions

View File

@ -23,7 +23,9 @@ export default async (req, res) => {
let user; let user;
try { try {
user = await Data.getUserByUsername({ username: req.body.data.username }); user = await Data.getUserByUsername({
username: req.body.data.username.toLowerCase(),
});
} catch (e) { } catch (e) {
console.log(e); console.log(e);
} }

View File

@ -62,7 +62,7 @@ export default async (req, res) => {
const user = await Data.createUser({ const user = await Data.createUser({
password: triple, password: triple,
salt, salt,
username: req.body.data.username, username: req.body.data.username.toLowerCase(),
data: { data: {
photo: "https://slate.host/static/a1.jpg", photo: "https://slate.host/static/a1.jpg",
settings_deals_auto_approve: false, settings_deals_auto_approve: false,

View File

@ -105,7 +105,7 @@ export default class SceneSignIn extends React.Component {
} }
const response = await this.props.onAuthenticate({ const response = await this.props.onAuthenticate({
username: this.state.username, username: this.state.username.toLowerCase(),
password: this.state.password, password: this.state.password,
}); });