airmap-auth
Advanced tools
Comparing version 1.5.0 to 1.5.1
@@ -5,2 +5,7 @@ # Change Log | ||
<a name="1.5.1"></a> | ||
## [1.5.1](https://github.com/airmap/js-auth/compare/v1.5.0...v1.5.1) (2017-12-04) | ||
<a name="1.5.0"></a> | ||
@@ -7,0 +12,0 @@ # [1.5.0](https://github.com/airmap/js-auth/compare/v1.3.2...v1.5.0) (2017-10-22) |
@@ -123,3 +123,3 @@ 'use strict'; | ||
var authErr = new AuthorizationError(err.error_description.type); | ||
_this._showAuthError(authErr.getText()); | ||
_this._showAuthError(authErr.getText(_this.opts.language)); | ||
_this.opts.onAuthorizationError(error); | ||
@@ -126,0 +126,0 @@ }); |
@@ -5,2 +5,4 @@ 'use strict'; | ||
var _constants = require('./constants'); | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
@@ -38,3 +40,3 @@ | ||
this.type = type; | ||
this.type = _constants.authorizationErrorsConsts['en'][type] ? type : '__default__'; | ||
} | ||
@@ -45,13 +47,5 @@ | ||
value: function getText() { | ||
switch (this.type) { | ||
case 'domain_blacklist': | ||
return 'Sorry, we are unable to create an account for this email address. Please register with an address from another domain.'; | ||
break; | ||
case 'email_verification': | ||
return 'Your email address has not been verified. Please click the link that was sent to you.'; | ||
break; | ||
default: | ||
return 'There was an error authenticating.'; | ||
break; | ||
} | ||
var lang = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'en'; | ||
return _constants.authorizationErrorsConsts[lang][this.type]; | ||
} | ||
@@ -58,0 +52,0 @@ }]); |
{ | ||
"name": "airmap-auth", | ||
"version": "1.5.0", | ||
"version": "1.5.1", | ||
"description": "Authenticate users with AirMap", | ||
@@ -5,0 +5,0 @@ "author": "AirMap, Inc. <developers@airmap.com> (https://airmap.com)", |
Sorry, the diff of this file is too big to display
21
5948
1450105