Skip to content

Commit

Permalink
Release 3.0.3 (#49)
Browse files Browse the repository at this point in the history
* Release 3.0.3

* Upgraded to latest auth0-js
  • Loading branch information
Steve Hobbs authored Dec 19, 2019
1 parent c88a841 commit 61b7a1a
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 25 deletions.
40 changes: 20 additions & 20 deletions dist/angular-lock.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
(function() {
'use strict';
angular.module('auth0.lock', []).provider('lock', lock);
"use strict";
angular.module("auth0.lock", []).provider("lock", lock);

function lock() {
if (typeof Auth0Lock !== 'function') {
throw new Error('Auth0Lock must be loaded.');
if (typeof Auth0Lock !== "function") {
throw new Error("Auth0Lock must be loaded.");
}

// Stub required functions to allow auth0-angular to initialize
Expand All @@ -17,43 +17,43 @@

this.init = function(config) {
if (!config) {
throw new Error('clientID and domain must be provided to lock');
throw new Error("clientID and domain must be provided to lock");
}
this.clientID = config.clientID;
this.domain = config.domain;
this.options = config.options || {};
this.options._telemetryInfo = {
name: 'angular-lock',
version: '3.0.2'
name: "angular-lock",
version: "3.0.3"
};
};

this.$get = [
'$rootScope',
'$location',
"$rootScope",
"$location",
function($rootScope, $location) {
var Lock = new Auth0Lock(this.clientID, this.domain, this.options);
var webAuthOptions = {
var webAuthOptions = {
clientID: this.clientID,
domain: this.domain,
_telemetryInfo: this.options._telemetryInfo,
_sendTelemetry: this.options._sendTelemetry
};
};
var shouldVerifyIdToken = true;
if (this.options._idTokenVerification === false)
shouldVerifyIdToken = false;
var lock = {};
var functions = [];
for (var i in Lock) {
if (typeof Lock[i] === 'function') {
if (typeof Lock[i] === "function") {
functions.push(i);
}
}

function safeApply(fn) {
var phase = $rootScope.$root.$$phase;
if (phase === '$apply' || phase === '$digest') {
if (fn && typeof fn === 'function') {
if (phase === "$apply" || phase === "$digest") {
if (fn && typeof fn === "function") {
fn();
}
} else {
Expand All @@ -64,7 +64,7 @@
function wrapArguments(parameters) {
var lastIndex = parameters.length - 1,
func = parameters[lastIndex];
if (typeof func === 'function') {
if (typeof func === "function") {
parameters[lastIndex] = function() {
var args = arguments;
safeApply(function() {
Expand All @@ -85,12 +85,12 @@
}

lock.interceptHash = function() {
if (typeof auth0.WebAuth !== 'function') {
throw new Error('Auth0.js version 8 or higher must be loaded');
if (typeof auth0.WebAuth !== "function") {
throw new Error("Auth0.js version 8 or higher must be loaded");
return;
}

$rootScope.$on('$locationChangeStart', function(event, location) {
$rootScope.$on("$locationChangeStart", function(event, location) {
if (
/id_token=/.test(location) ||
/access_token=/.test(location) ||
Expand All @@ -104,10 +104,10 @@
{ hash: hash, _idTokenVerification: shouldVerifyIdToken },
function(err, authResult) {
if (err) {
Lock.emit('authorization_error', err);
Lock.emit("authorization_error", err);
}
if (authResult && authResult.idToken) {
Lock.emit('authenticated', authResult);
Lock.emit("authenticated", authResult);
}
}
);
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "angular-lock",
"version": "3.0.2",
"version": "3.0.3",
"description": "Angular wrapper for Lock",
"main": "angular-lock.js",
"repository": {
Expand All @@ -26,6 +26,6 @@
"gulp-uglify": "^2.1.0"
},
"dependencies": {
"auth0-js": "^9.12.0"
"auth0-js": "^9.12.1"
}
}
6 changes: 3 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,9 @@ atob@^2.1.1:
integrity sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==

auth0-js@^9.12.0:
version "9.12.0"
resolved "https://registry.yarnpkg.com/auth0-js/-/auth0-js-9.12.0.tgz#6b8ac52767382366b1f81d85e394329174c54dc3"
integrity sha512-OnI04ISKF7SGOlP8MFqnVUNPwVaceynwkjA6f55z2CsZaUXynTTiTtGRhyU2c88kR4skPx1si0SKowzzy38+aw==
version "9.12.1"
resolved "https://registry.yarnpkg.com/auth0-js/-/auth0-js-9.12.1.tgz#ffe76acdbd66ad61a0a71c818d69a599c8228937"
integrity sha512-0BqClX8iRYWeX8lM6V1h9Yg0ZSxs+naM+dMiknfdwr8g7HNLEXqRc1Wx4iZUJfF4PTU5pDksRkiWvjDFQbt2SA==
dependencies:
base64-js "^1.3.0"
idtoken-verifier "^2.0.0"
Expand Down

0 comments on commit 61b7a1a

Please sign in to comment.