airmap-auth
Advanced tools
Comparing version 2.0.1 to 2.0.2
20
API.md
@@ -67,4 +67,4 @@ ## Modules | ||
**Kind**: instance method of <code>[AirMapAuth](#AirMapAuth)</code> | ||
**Access:** public | ||
**Kind**: instance method of [<code>AirMapAuth</code>](#AirMapAuth) | ||
**Access**: public | ||
<a name="AirMapAuth+isAuthenticated"></a> | ||
@@ -75,5 +75,5 @@ | ||
**Kind**: instance method of <code>[AirMapAuth](#AirMapAuth)</code> | ||
**Kind**: instance method of [<code>AirMapAuth</code>](#AirMapAuth) | ||
**Returns**: <code>boolean</code> - - If `true`, user has a valid, authenticated token. If `false`, user does not have a valid token. | ||
**Access:** public | ||
**Access**: public | ||
<a name="AirMapAuth+getUserId"></a> | ||
@@ -85,5 +85,5 @@ | ||
**Kind**: instance method of <code>[AirMapAuth](#AirMapAuth)</code> | ||
**Kind**: instance method of [<code>AirMapAuth</code>](#AirMapAuth) | ||
**Returns**: <code>string</code> - returns the user's id (if authenticated), null if profile could not be retrieved. | ||
**Access:** public | ||
**Access**: public | ||
<a name="AirMapAuth+getUserToken"></a> | ||
@@ -94,5 +94,5 @@ | ||
**Kind**: instance method of <code>[AirMapAuth](#AirMapAuth)</code> | ||
**Kind**: instance method of [<code>AirMapAuth</code>](#AirMapAuth) | ||
**Returns**: <code>string</code> - returns the user's token (if authenticated), null if user is not authenticated (active session). | ||
**Access:** public | ||
**Access**: public | ||
<a name="AirMapAuth+logout"></a> | ||
@@ -103,4 +103,4 @@ | ||
**Kind**: instance method of <code>[AirMapAuth](#AirMapAuth)</code> | ||
**Access:** public | ||
**Kind**: instance method of [<code>AirMapAuth</code>](#AirMapAuth) | ||
**Access**: public | ||
@@ -107,0 +107,0 @@ | Param | Type | Default | Description | |
@@ -26,3 +26,3 @@ { | ||
], | ||
"version": "2.0.1" | ||
"version": "2.0.2" | ||
} |
@@ -5,2 +5,13 @@ # Change Log | ||
<a name="2.0.2"></a> | ||
## [2.0.2](https://github.com/airmap/js-auth/compare/v2.0.1...v2.0.2) (2018-06-26) | ||
### Bug Fixes | ||
* Handle errors using hosted login. ([b38540e](https://github.com/airmap/js-auth/commit/b38540e)) | ||
* Update vulnerable dependencies. ([6dca9d7](https://github.com/airmap/js-auth/commit/6dca9d7)) | ||
<a name="2.0.1"></a> | ||
@@ -7,0 +18,0 @@ ## [2.0.1](https://github.com/airmap/js-auth/compare/v2.0.0...v2.0.1) (2018-05-22) |
@@ -75,3 +75,3 @@ 'use strict'; | ||
value: function _initAuth() { | ||
var _this2 = this; | ||
var _this = this; | ||
@@ -89,3 +89,3 @@ // Checks localStorage browser support | ||
document.addEventListener('DOMContentLoaded', function () { | ||
_this2.showAuth(); | ||
_this.showAuth(); | ||
}); | ||
@@ -104,8 +104,9 @@ } | ||
value: function _handleAuthentication() { | ||
var _this = this; | ||
var _this2 = this; | ||
this._webAuth.parseHash(function (err, authResult) { | ||
if (authResult && authResult.idToken) { | ||
_this._setSession(authResult); | ||
_this2._setSession(authResult); | ||
} else if (err) { | ||
_this._setError(err); | ||
_this2._setError(err); | ||
} | ||
@@ -141,8 +142,21 @@ }); | ||
this.logout(); | ||
var description = void 0; | ||
try { | ||
description = JSON.parse(error.errorDescription); | ||
} catch (e) { | ||
description = {}; | ||
} | ||
var err = _extends({}, error, { | ||
error_description: _extends({ | ||
type: '' | ||
}, [error.errorDescription]) | ||
}, description) | ||
}); | ||
var authErr = new AuthorizationError(err.error_description.type); | ||
// Redirecting errors to hosted login is a workaround until there's a | ||
// resolution for auth0/lock#637 and auth0/lock#692 | ||
this._webAuth.authorize({ | ||
language: this.opts.language, | ||
logo: this.opts.logo, | ||
flash_message: authErr.getText(this.opts.language) | ||
}); | ||
} | ||
@@ -149,0 +163,0 @@ |
{ | ||
"name": "airmap-auth", | ||
"version": "2.0.1", | ||
"version": "2.0.2", | ||
"description": "Authenticate users with AirMap", | ||
@@ -33,3 +33,3 @@ "author": "AirMap, Inc. <developers@airmap.com> (https://airmap.com)", | ||
"release": "sh ./scripts/release.sh", | ||
"start": "budo ./examples/index.js --serve=examples/bundle.js --port=8080 --live -ssl --cors --dir=examples -- -t babelify", | ||
"start": "budo ./examples/index.js --serve=examples/bundle.js --port=8080 --live --cors --dir=examples -- -t babelify", | ||
"test": "export NODE_PATH=./ && mocha --compilers js:babel-register --recursive test/setup.js test/unit/*", | ||
@@ -50,9 +50,9 @@ "test:circle": "export NODE_PATH=./ && mocha --compilers js:babel-register --recursive --reporter mocha-junit-reporter test/setup.js test/unit/* --reporter-options mochaFile=$CIRCLE_TEST_REPORTS/mocha/unit.xml" | ||
"browserify": "^13.1.0", | ||
"budo": "^7.0.2", | ||
"budo": "^11.2.2", | ||
"chai": "^3.5.0", | ||
"jsdoc": "^3.4.0", | ||
"jsdoc-to-markdown": "^1.3.7", | ||
"jsdoc-to-markdown": "^4.0.1", | ||
"jsdom": "^9.4.2", | ||
"mocha": "^3.0.2", | ||
"mocha-junit-reporter": "^1.12.0", | ||
"mocha": "^5.2.0", | ||
"mocha-junit-reporter": "^1.17.0", | ||
"sinon": "^1.17.5", | ||
@@ -59,0 +59,0 @@ "sinon-chai": "^2.8.0", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
522381
2412