Implement auth with jwt and add endpoints

This commit is contained in:
2020-05-08 13:12:10 +02:00
parent fce5a162d3
commit 4b5a5b2477
8 changed files with 218 additions and 3 deletions

View File

@@ -6,6 +6,7 @@ module.exports = {
updateAccount,
deleteAccount,
getMeetingsByAccountId,
getAccountByEmail,
};
function addAccount(data) {
@@ -67,3 +68,18 @@ function getAccountById(id) {
'latest_time',
);
}
function getAccountByEmail(email) {
return db('account')
.where({ email })
.first()
.select(
'id',
'username',
'password',
'email',
'timezone',
'earliest_time',
'latest_time',
);
}