fix: Add a build system for the backend

This commit is contained in:
Alexander Polynomdivision
2018-09-21 16:27:25 +02:00
parent 8061535936
commit db4b46b5aa
9 changed files with 4752 additions and 29 deletions

View File

@@ -1,5 +1,7 @@
import { pbkdf2Sync } from "crypto";
import { IUser } from "shared/user";
export function isAuthenticated(token: string): Promise<boolean> {
return new Promise((res, rej) => {
// TODO
@@ -7,7 +9,7 @@ export function isAuthenticated(token: string): Promise<boolean> {
});
}
export function performLogin(username: string, password: string): Promise<any | {}> {
export function performLogin(username: string, password: string): Promise<IUser | {}> {
return new Promise((res, rej) => {
// Hash the password
// TODO: Fetch the salt
@@ -18,8 +20,9 @@ export function performLogin(username: string, password: string): Promise<any |
res({
username: "Polynom",
uid: "1",
showWelcome: false,
showWelcome: true,
classId: "test",
score: 4,
sessionToken: "abc123",
});