diff --git a/dist/amd/authentication.js b/dist/amd/authentication.js index ec8d758..c5ce5c7 100644 --- a/dist/amd/authentication.js +++ b/dist/amd/authentication.js @@ -63,12 +63,10 @@ define(['exports', 'aurelia-dependency-injection', './baseConfig', './storage', var base64 = base64Url.replace(/-/g, '+').replace(/_/g, '/'); try { - var _parsed = JSON.parse(decodeURIComponent(escape(window.atob(base64)))); + return JSON.parse(decodeURIComponent(escape(window.atob(base64)))); } catch (error) { - return; + return null; } - - return parsed; } } }, { diff --git a/dist/commonjs/authentication.js b/dist/commonjs/authentication.js index 0803cb1..7b2baa4 100644 --- a/dist/commonjs/authentication.js +++ b/dist/commonjs/authentication.js @@ -70,12 +70,10 @@ var Authentication = (function () { var base64 = base64Url.replace(/-/g, '+').replace(/_/g, '/'); try { - var _parsed = JSON.parse(decodeURIComponent(escape(window.atob(base64)))); + return JSON.parse(decodeURIComponent(escape(window.atob(base64)))); } catch (error) { - return; + return null; } - - return parsed; } } }, { diff --git a/dist/es6/authentication.js b/dist/es6/authentication.js index 9c0e633..19ec16e 100644 --- a/dist/es6/authentication.js +++ b/dist/es6/authentication.js @@ -44,13 +44,10 @@ export class Authentication { let base64 = base64Url.replace(/-/g, '+').replace(/_/g, '/'); try { - let parsed = JSON.parse(decodeURIComponent(escape(window.atob(base64)))); + return JSON.parse(decodeURIComponent(escape(window.atob(base64)))); } catch (error) { - return; + return null; } - - return parsed; - } } diff --git a/dist/system/authentication.js b/dist/system/authentication.js index c95e8e7..ba3ff0d 100644 --- a/dist/system/authentication.js +++ b/dist/system/authentication.js @@ -68,12 +68,10 @@ System.register(['aurelia-dependency-injection', './baseConfig', './storage', '. var base64 = base64Url.replace(/-/g, '+').replace(/_/g, '/'); try { - var _parsed = JSON.parse(decodeURIComponent(escape(window.atob(base64)))); + return JSON.parse(decodeURIComponent(escape(window.atob(base64)))); } catch (error) { - return; + return null; } - - return parsed; } } }, { diff --git a/doc/CHANGELOG.md b/doc/CHANGELOG.md index b2b1b61..4181c8d 100644 --- a/doc/CHANGELOG.md +++ b/doc/CHANGELOG.md @@ -1,3 +1,6 @@ +### 0.12.2 (2016-02-07) + + ### 0.12.2 (2016-02-02) diff --git a/package.json b/package.json index 8c22f85..13ddce6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "aurelia-auth", - "version": "0.12.1", + "version": "0.12.2", "description": "Plugin for social media authentication and local authentication together with other authentication utilities", "main": "dist/system/index.js", "scripts": { diff --git a/src/authentication.js b/src/authentication.js index 9c0e633..19ec16e 100644 --- a/src/authentication.js +++ b/src/authentication.js @@ -44,13 +44,10 @@ export class Authentication { let base64 = base64Url.replace(/-/g, '+').replace(/_/g, '/'); try { - let parsed = JSON.parse(decodeURIComponent(escape(window.atob(base64)))); + return JSON.parse(decodeURIComponent(escape(window.atob(base64)))); } catch (error) { - return; + return null; } - - return parsed; - } }