1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-12-23 16:38:45 +01:00

rebuild tokenrequest obj on login api

This commit is contained in:
Kyle Spearrin 2017-09-06 15:52:06 -04:00
parent fbb9ae38d5
commit ff0fde161e
2 changed files with 27 additions and 23 deletions

View File

@ -24,8 +24,9 @@ var TokenRequest = function (email, masterPasswordHash, provider, token, remembe
if (device) {
this.device = device;
}
};
this.toIdentityToken = function () {
TokenRequest.prototype.toIdentityToken = function () {
var obj = {
grant_type: 'password',
username: this.email,
@ -48,7 +49,6 @@ var TokenRequest = function (email, masterPasswordHash, provider, token, remembe
}
return obj;
};
};
var RegisterRequest = function (email, masterPasswordHash, masterPasswordHint, key) {

View File

@ -55,6 +55,10 @@ function initApiService() {
ApiService.prototype.postIdentityToken = function (tokenRequest, success, successWithTwoFactor, error) {
var self = this;
// Hack for Edge. For some reason tokenRequest loses proto. Rebuild it here.
tokenRequest = new TokenRequest(tokenRequest.email, tokenRequest.masterPasswordHash, tokenRequest.provider,
tokenRequest.token, tokenRequest.remeber, tokenRequest.device);
$.ajax({
type: 'POST',
url: self.identityBaseUrl + '/connect/token',