1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-21 18:53:29 +00:00

choose auth scheme based on token issuer

This commit is contained in:
Kyle Spearrin
2017-05-05 23:19:38 -04:00
parent 0e30362173
commit cd07f58535
2 changed files with 37 additions and 19 deletions

View File

@@ -214,6 +214,16 @@ function initTokenService() {
return decoded.name;
};
TokenService.prototype.getIssuer = function () {
var decoded = this.decodeToken();
if (typeof decoded.iss === 'undefined') {
throw 'No issuer found';
}
return decoded.iss;
};
function urlBase64Decode(str) {
var output = str.replace(/-/g, '+').replace(/_/g, '/');
switch (output.length % 4) {