aboutsummaryrefslogtreecommitdiff
path: root/src/db/model
diff options
context:
space:
mode:
authorjw2552018-04-22 17:57:35 +0100
committerjw2552018-04-22 17:57:35 +0100
commitde3deb507bcbcb5ee2a6c323058b9b3e877614f9 (patch)
tree5619f162956eb84c9d8214c29c31e218c0959b1d /src/db/model
parentMerge branch 'trh/gets' of https://gitlab.cs.st-andrews.ac.uk/cs3099group-be-... (diff)
downloadmedicine-de3deb507bcbcb5ee2a6c323058b9b3e877614f9.tar.gz
medicine-de3deb507bcbcb5ee2a6c323058b9b3e877614f9.zip

fixxed tests

Diffstat (limited to 'src/db/model')
-rw-r--r--src/db/model/User.ts7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/db/model/User.ts b/src/db/model/User.ts
index aa356c7..2dd0b6b 100644
--- a/src/db/model/User.ts
+++ b/src/db/model/User.ts
@@ -189,11 +189,10 @@ export default class User extends Model<User> {
private_user_metadata?: Metadata;
}): void {
if (newInfo.password !== undefined) {
- if (this.authenticate(newInfo.password.old)) {
+ if (!this.authenticate(newInfo.password.old)) {
this.passwordInternal = newInfo.password.new;
- }
- else{
- throw new RequestError(400, 'invalid_password')
+ } else {
+ throw new RequestError(400, 'invalid_password');
}
}
}