mirror of
https://github.com/SyncrowIOT/backend.git
synced 2026-10-23 09:47:54 +00:00
Add app agreement acceptance check and validation
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user