added functionality for user subscriptions
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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) {
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user