user canAccessPremium checks

This commit is contained in:
Kyle Spearrin 2018-08-28 23:17:44 -04:00
parent f704b62db5
commit 3fa63ee2c2
2 changed files with 4 additions and 3 deletions

2
jslib

@ -1 +1 @@
Subproject commit 3c43265878892adab985f6fc9b1b4270ae27aaa2
Subproject commit 81c21418ec965221b4d322008f9da0ab7b9037d0

View File

@ -182,11 +182,12 @@ export class GetCommand {
return Response.error('Couldn\'t generate TOTP code.');
}
if (!this.tokenService.getPremium()) {
const canAccessPremium = await this.userService.canAccessPremium();
if (!canAccessPremium) {
const originalCipher = await this.cipherService.get(id);
if (originalCipher == null || originalCipher.organizationId == null ||
!originalCipher.organizationUseTotp) {
return Response.error('A premium membership is required to use this feature.');
return Response.error('Premium status is required to use this feature.');
}
}