Alongside the token the value of admin state is also sent.

This commit is contained in:
2018-03-07 01:35:40 +01:00
parent 858f3f5d57
commit ba96e27c43
3 changed files with 15 additions and 7 deletions

View File

@@ -9,7 +9,7 @@ class UserRepository {
create: 'insert into user (user_name) values (?)',
change: 'update user set password = ? where user_name = ?',
retrieveHash: 'select * from user where user_name = ?',
getAdminByUser: 'select admin from user where user_name = ?'
getAdminStateByUser: 'select admin from user where user_name = ?'
};
}
@@ -51,8 +51,8 @@ class UserRepository {
return this.database.run(this.queries.change, [password, user.username]);
}
isAdmin(user) {
return this.database.get(this.queries.getAdminByUser, user.username).then((row) => {
checkAdmin(user) {
return this.database.get(this.queries.getAdminStateByUser, user.username).then((row) => {
return row.admin;
})
}