added functionality for user subscriptions

This commit is contained in:
Mikayla Dobson
2022-11-26 12:52:59 -06:00
parent 99c48d2a6e
commit 03ec2bf38c
18 changed files with 279 additions and 40 deletions

View File

@@ -14,6 +14,7 @@ export default class AuthService {
data.datecreated = now;
data.datemodified = now;
data.active = true;
data.isadmin = false;
try {
const user = await UserInstance.getOneByEmail(email);
@@ -29,7 +30,6 @@ export default class AuthService {
}
const result = await UserInstance.post(newData);
if (result) console.log(result);
return result;
})
})
@@ -46,7 +46,6 @@ export default class AuthService {
const user = await UserInstance.getOneByEmail(email);
if (!user) return { ok: false, user: null }
const match = await bcrypt.compare(password, user.password);
console.log(match);
return {
ok: match,
user: match ? user : null

View File

@@ -6,4 +6,16 @@ export function restrictAccess(req: Request, res: Response, next: NextFunction)
} else {
res.send({ ok: false, user: undefined })
}
}
export function checkSubscription(req: Request, res: Response, next: NextFunction) {
}
export function checkFriendStatus(req: Request, res: Response, next: NextFunction) {
}
export function checkIsAdmin(req: Request, res: Response, next: NextFunction) {
}