Add validation for vcard.
This commit is contained in:
@@ -12,7 +12,7 @@ import {MutableKeyStore, PGPSigner, Signer} from '@app/_pgp';
|
||||
import {RegistryService} from '@app/_services/registry.service';
|
||||
import {CICRegistry} from 'cic-client';
|
||||
import {AuthService} from './auth.service';
|
||||
import {personValidation} from '@app/_helpers';
|
||||
import {personValidation, vcardValidation} from '@app/_helpers';
|
||||
const vCard = require('vcard-parser');
|
||||
|
||||
@Injectable({
|
||||
@@ -88,6 +88,7 @@ export class UserService {
|
||||
accountInfo.location.area = location;
|
||||
accountInfo.location.area_name = userLocation;
|
||||
accountInfo.location.area_type = locationType;
|
||||
await vcardValidation(accountInfo.vcard);
|
||||
accountInfo.vcard = btoa(vCard.generate(accountInfo.vcard));
|
||||
await personValidation(accountInfo);
|
||||
const accountKey = await User.toKey(address);
|
||||
@@ -188,6 +189,7 @@ export class UserService {
|
||||
await personValidation(accountInfo);
|
||||
accountInfo.balance = await this.tokenService.getTokenBalance(accountInfo.identities.evm['bloxberg:8996'][0]);
|
||||
accountInfo.vcard = vCard.parse(atob(accountInfo.vcard));
|
||||
await vcardValidation(accountInfo.vcard);
|
||||
this.accounts.unshift(accountInfo);
|
||||
if (this.accounts.length > limit) {
|
||||
this.accounts.length = limit;
|
||||
|
||||
Reference in New Issue
Block a user