Add app agreement acceptance check and validation

This commit is contained in:
faris Aljohari
2025-01-22 00:34:47 -06:00
parent 41da528963
commit 6dd6c79d87
3 changed files with 34 additions and 4 deletions
@@ -48,7 +48,9 @@ export class AuthService {
if (!user.isActive) {
throw new BadRequestException('User is not active');
}
if (!user.hasAcceptedAppAgreement) {
throw new BadRequestException('User has not accepted app agreement');
}
const passwordMatch = await this.helperHashService.bcryptCompare(
pass,
user.password,
@@ -92,6 +94,8 @@ export class AuthService {
sessionId: user.sessionId,
role: user?.role,
googleCode: user.googleCode,
hasAcceptedWebAgreement: user.hasAcceptedWebAgreement,
hasAcceptedAppAgreement: user.hasAcceptedAppAgreement,
};
if (payload.googleCode) {
const profile = await this.getProfile(payload.googleCode);