Skip to content
Snippets Groups Projects
Commit bf34673b authored by Alexandru Munteanu's avatar Alexandru Munteanu
Browse files

feat(change-password): fix change password api

parent 0cb26953
No related branches found
No related tags found
1 merge request!14Sprint #15
...@@ -14,7 +14,7 @@ module.exports = models => async (req, res) => { ...@@ -14,7 +14,7 @@ module.exports = models => async (req, res) => {
let user let user
try { try {
user = await models.User.find(req.user) user = await models.User.find(req.user)
if (!user.validPassword(password)) { if (!await user.validPassword(password)) {
return res.status(400).json({ error: 'Wrong username or password.' }) return res.status(400).json({ error: 'Wrong username or password.' })
} }
user.password = newPassword user.password = newPassword
......
...@@ -17,7 +17,7 @@ const EditUserForm = ({ ...@@ -17,7 +17,7 @@ const EditUserForm = ({
{subtitle && <Subtitle>{subtitle}</Subtitle>} {subtitle && <Subtitle>{subtitle}</Subtitle>}
<Row> <Row>
<RowItem> <RowItem>
<Label> First name*1 </Label> <Label> First name* </Label>
<ValidatedField <ValidatedField
component={TextField} component={TextField}
name="firstName" name="firstName"
...@@ -70,9 +70,9 @@ const EditUserForm = ({ ...@@ -70,9 +70,9 @@ const EditUserForm = ({
component={input => ( component={input => (
<Checkbox <Checkbox
checked={input.value} checked={input.value}
label="Editor in Chief"
type="checkbox" type="checkbox"
{...input} {...input}
label="Editor in Chief"
/> />
)} )}
name="editorInChief" name="editorInChief"
...@@ -81,9 +81,9 @@ const EditUserForm = ({ ...@@ -81,9 +81,9 @@ const EditUserForm = ({
component={input => ( component={input => (
<Checkbox <Checkbox
checked={input.value} checked={input.value}
label="Handling Editor"
type="checkbox" type="checkbox"
{...input} {...input}
label="Handling Editor"
/> />
)} )}
name="handlingEditor" name="handlingEditor"
...@@ -92,9 +92,9 @@ const EditUserForm = ({ ...@@ -92,9 +92,9 @@ const EditUserForm = ({
component={input => ( component={input => (
<Checkbox <Checkbox
checked={input.value} checked={input.value}
label="Admin"
type="checkbox" type="checkbox"
{...input} {...input}
label="Admin"
/> />
)} )}
name="admin" name="admin"
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment