mirror of
https://github.com/bitwarden/browser.git
synced 2025-01-12 19:50:46 +01:00
get premium status from token
This commit is contained in:
parent
1053491d28
commit
94a13954a5
@ -2,7 +2,7 @@ angular
|
|||||||
.module('bit.vault')
|
.module('bit.vault')
|
||||||
|
|
||||||
.controller('vaultViewLoginController', function ($scope, $state, $stateParams, loginService, toastr, $q,
|
.controller('vaultViewLoginController', function ($scope, $state, $stateParams, loginService, toastr, $q,
|
||||||
$analytics, i18nService, utilsService, totpService, $timeout) {
|
$analytics, i18nService, utilsService, totpService, $timeout, tokenService) {
|
||||||
$scope.i18n = i18nService;
|
$scope.i18n = i18nService;
|
||||||
var from = $stateParams.from,
|
var from = $stateParams.from,
|
||||||
totpInterval = null;
|
totpInterval = null;
|
||||||
@ -39,7 +39,7 @@ angular
|
|||||||
$scope.login.showLaunch = false;
|
$scope.login.showLaunch = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (model.totp && (login.organizationUseTotp || false)) {
|
if (model.totp && (login.organizationUseTotp || tokenService.getPremium())) {
|
||||||
totpUpdateCode();
|
totpUpdateCode();
|
||||||
totpTick();
|
totpTick();
|
||||||
|
|
||||||
|
@ -254,6 +254,16 @@ function initTokenService() {
|
|||||||
return decoded.name;
|
return decoded.name;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
TokenService.prototype.getPremium = function () {
|
||||||
|
var decoded = this.decodeToken();
|
||||||
|
|
||||||
|
if (typeof decoded.premium === 'undefined') {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return !!decoded.premium;
|
||||||
|
};
|
||||||
|
|
||||||
TokenService.prototype.getIssuer = function () {
|
TokenService.prototype.getIssuer = function () {
|
||||||
var decoded = this.decodeToken();
|
var decoded = this.decodeToken();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user