Authentication middleware complete for requests with an authroization header

This commit is contained in:
Ben
2018-09-06 18:03:31 +01:00
parent 299be3618d
commit 3ed9ed4cbd
5 changed files with 482 additions and 10 deletions

View File

@@ -0,0 +1,8 @@
import {Database} from '../database/database';
export class AuthModel {
static async getUserFromToken(token) {
let id = await Database.auth.getIDByToken(token);
return await Database.users.getUserByID(id.id);
}
}