diff --git a/pages/api/sign-in.js b/pages/api/sign-in.js index d5309904..4615cf88 100644 --- a/pages/api/sign-in.js +++ b/pages/api/sign-in.js @@ -23,7 +23,9 @@ export default async (req, res) => { let user; try { - user = await Data.getUserByUsername({ username: req.body.data.username }); + user = await Data.getUserByUsername({ + username: req.body.data.username.toLowerCase(), + }); } catch (e) { console.log(e); } diff --git a/pages/api/users/create.js b/pages/api/users/create.js index 6f989ebe..200a0760 100644 --- a/pages/api/users/create.js +++ b/pages/api/users/create.js @@ -62,7 +62,7 @@ export default async (req, res) => { const user = await Data.createUser({ password: triple, salt, - username: req.body.data.username, + username: req.body.data.username.toLowerCase(), data: { photo: "https://slate.host/static/a1.jpg", settings_deals_auto_approve: false, diff --git a/scenes/SceneSignIn.js b/scenes/SceneSignIn.js index 6b1cb248..e678f355 100644 --- a/scenes/SceneSignIn.js +++ b/scenes/SceneSignIn.js @@ -105,7 +105,7 @@ export default class SceneSignIn extends React.Component { } const response = await this.props.onAuthenticate({ - username: this.state.username, + username: this.state.username.toLowerCase(), password: this.state.password, });