auth0-angular
Advanced tools
Comparing version 2.2.1 to 2.2.3
@@ -313,2 +313,4 @@ (function () { | ||
forbidden(); | ||
}).finally(function () { | ||
refreshingToken = null; | ||
}); | ||
@@ -368,3 +370,3 @@ } else { | ||
var successHandlers = getHandlers('loginSuccess'); | ||
if (!options.popup && !options.username && (!successHandlers || successHandlers.length === 0)) { | ||
if (!options.popup && (!options.username || !options.email) && (!successHandlers || successHandlers.length === 0)) { | ||
throw new Error('You must define a loginSuccess handler ' + 'if not using popup mode or not doing ro call because that means you are doing a redirect'); | ||
@@ -371,0 +373,0 @@ } |
@@ -1,1 +0,1 @@ | ||
!function(){angular.module("auth0",["auth0.storage","auth0.service","auth0.interceptor","auth0.utils"]),angular.module("auth0.utils",[]).provider("authUtils",function(){var a={capitalize:function(a){return a?a.charAt(0).toUpperCase()+a.substring(1).toLowerCase():null},urlBase64Decode:function(a){var b=a.replace("-","+").replace("_","/");switch(b.length%4){case 0:break;case 2:b+="==";break;case 3:b+="=";break;default:throw"Illegal base64url string!"}return window.atob(b)}};angular.extend(this,a),this.$get=["$rootScope","$q",function(b,c){var d={};return angular.extend(d,a),d.safeApply=function(a){var c=b.$root.$$phase;"$apply"===c||"$digest"===c?a&&"function"==typeof a&&a():b.$apply(a)},d.callbackify=function(a,b,c,e){return angular.isFunction(a)?function(f){f=Array.prototype.slice.call(arguments);var g=function(a,d,e){return a?void(c&&c(a)):(e=Array.prototype.slice.call(arguments,1),void(b&&b.apply(null,e)))};f.push(d.applied(g)),a.apply(e,f)}:void 0},d.promisify=function(a,b){return angular.isFunction(a)?function(e){e=Array.prototype.slice.call(arguments);var f=c.defer(),g=function(a,b,c){return a?void f.reject(a):(c=Array.prototype.slice.call(arguments,1),void f.resolve(c.length>1?c:b))};return e.push(d.applied(g)),a.apply(b,e),f.promise.spread=f.promise.spread||function(a,b){return f.promise.then(function(b){return Array.isArray(b)?a.apply(null,b):a(b)},b)},f.promise}:void 0},d.applied=function(a){return function(b,c){b=b,c=c;var e=arguments;d.safeApply(function(){a.apply(null,e)})}},d}]}),angular.module("auth0.interceptor",[]).factory("authInterceptor",["$rootScope","$q","$injector",function(a,b,c){return{request:function(a){if(!c.has("auth"))return a;var b=c.get("auth");return a.headers=a.headers||{},b.idToken&&!a.headers.Authorization&&(a.headers.Authorization="Bearer "+b.idToken),a},responseError:function(c){return 401===c.status&&a.$broadcast("auth0.forbidden",c),b.reject(c)}}}]),angular.module("auth0.storage",[]).service("authStorage",["$injector",function(a){var b,c,d=null;if(localStorage)b=function(a,b){return localStorage.setItem(a,b)},c=function(a){return localStorage.getItem(a)},d=function(a){return localStorage.removeItem(a)};else{var e=a.get("$cookieStore");b=function(a,b){return e.put(a,b)},c=function(a){return e.get(a)},d=function(a){return e.remove(a)}}this.store=function(a,c,d,e){b("idToken",a),c&&b("accessToken",c),d&&b("state",d),e&&b("refreshToken",e)},this.get=function(){return{idToken:c("idToken"),accessToken:c("accessToken"),state:c("state"),refreshToken:c("refreshToken")}},this.remove=function(){d("idToken"),d("accessToken"),d("state"),d("refreshToken")}}]),angular.module("auth0.service",["auth0.storage","auth0.utils"]).provider("auth",["authUtilsProvider",function(a){var b={callbackOnLocationHash:!0},c=this;this.init=function(a,c){if(!c&&"undefined"==typeof Auth0Widget&&"undefined"==typeof Auth0)throw new Error("You must add either Auth0Widget.js or Auth0.js");if(!a)throw new Error("You must set options when calling init");this.loginUrl=a.loginUrl,this.loginState=a.loginState,this.clientID=a.clientID,this.sso=a.sso,this.minutesToRenewToken=a.minutesToRenewToken||120;var d=c;d||"undefined"==typeof Auth0Widget||(d=Auth0Widget),d||"undefined"==typeof Auth0||(d=Auth0),this.auth0lib=new d(angular.extend(b,a)),this.auth0lib.getClient?(this.auth0js=this.auth0lib.getClient(),this.isWidget=!0):(this.auth0js=this.auth0lib,this.isWidget=!1)},this.eventHandlers={},this.on=function(a,b){this.eventHandlers[a]||(this.eventHandlers[a]=[]),this.eventHandlers[a].push(b)};var d=["loginSuccess","loginFailure","logout","forbidden"];angular.forEach(d,function(b){c["add"+a.capitalize(b)+"Handler"]=function(a){c.on(b,a)}}),this.$get=["$rootScope","$q","$injector","authStorage","$window","$location","authUtils",function(a,b,d,e,f,g,h){function i(){e.remove(),c.loginUrl?g.path(c.loginUrl):c.loginState?d.get("$state").go(c.loginState):l("forbidden")}var j={isAuthenticated:!1},k=function(a){return c.eventHandlers[a]},l=function(a,b){angular.forEach(k(a)||[],function(a){d.invoke(a,j,b)})},m=function(a,b,c,d,f){e.store(a,b,c,d);var g=j.getProfile(a),h={idToken:a,accessToken:b,state:c,refreshToken:d,isAuthenticated:!0};return angular.extend(j,h),l("loginSuccess",angular.extend({profile:g,locationEvent:f},h)),g},n=null;a.$on("$locationChangeStart",function(a){var b=c.auth0lib.parseHash(f.location.hash);if(!j.isAuthenticated){if(b&&b.id_token)return void m(b.id_token,b.access_token,b.state,b.refresh_token,a);var d=e.get();if(d&&d.idToken){if(j.hasTokenExpired(d.idToken))return void(d.refreshToken?(n=j.refreshToken(d.refreshToken),n.then(function(b){m(b,d.accessToken,d.state,d.refreshToken,a)},function(){i()})):i());var g=j.getTokenExpirationDate(d.idToken);return(new Date).valueOf()-g.valueOf()<=60*j.config.minutesToRenewToken*1e3&&j.renewIdToken(d.idToken).then(function(a){j.idToken=a}),void m(d.idToken,d.accessToken,d.state,d.refreshToken,a)}c.sso&&c.auth0js.getSSOData(h.applied(function(a,b){b.sso&&j.signin({popup:!1,connection:b.lastUsedConnection.strategy},c.auth0js)}))}}),a.$on("auth0.forbidden",function(){i()}),c.loginUrl&&a.$on("$routeChangeStart",function(a,b){b.$$route&&b.$$route.requiresLogin&&(j.isAuthenticated||n||g.path(c.loginUrl))}),c.loginState&&a.$on("$stateChangeStart",function(a,b){b.data&&b.data.requiresLogin&&(j.isAuthenticated||n||(a.preventDefault(),d.get("$state").go(c.loginState)))}),j.config=c;var o=function(a){var b=k("loginSuccess");if(!(a.popup||a.username||b&&0!==b.length))throw new Error("You must define a loginSuccess handler if not using popup mode or not doing ro call because that means you are doing a redirect")};return j.hookEvents=function(){},j.getTokenExpirationDate=function(a){var b=a.split(".");if(3!==b.length)return!0;var c=h.urlBase64Decode(b[1]);if(!c)return!0;try{c=JSON.parse(c)}catch(d){return!0}if(!c.exp)return!0;var e=new Date(0);return e.setUTCSeconds(c.exp),e},j.hasTokenExpired=function(a){if(!a)return!0;var b=j.getTokenExpirationDate(a);return isNaN(b)?!0:b.valueOf()>(new Date).valueOf()?!1:!0},j.getToken=function(a){a=a||{scope:"openid"},a.id_token||a.refresh_token||(a.id_token=j.idToken);var b=h.promisify(c.auth0js.getDelegationToken,c.auth0js);return b(a).then(function(a){return a.id_token})},j.refreshToken=function(a){var b=h.promisify(c.auth0js.refreshToken,c.auth0js);return b(a||j.refreshToken).then(function(a){return a.id_token})},j.renewIdToken=function(a){var b=h.promisify(c.auth0js.renewIdToken,c.auth0js);return b(a||j.idToken).then(function(a){return a.id_token})},j.signin=function(a,b,d,e){a=a||{},o(a);var f=e||c.auth0lib,g=h.callbackify(f.signin,function(a,c,d,e,f){m(c,d,e,f).then(function(a){b&&b(a)})},function(a){l("loginFailure",{error:a}),d&&d(a)},f);c.isWidget?g(a,null):g(a)},j.signup=function(a,b,d){a=a||{},o(a);var e=c.auth0lib,f=h.callbackify(e.signup,function(c,d,e,f,g){angular.isUndefined(a.auto_login)||a.auto_login?m(d,e,f,g).then(function(a){b&&b(a)}):b()},function(a){l("loginFailure",{error:a}),d&&d(a)},e);c.isWidget?f(a,null):f(a)},j.reset=function(a,b,d){a=a||{};var e,f=c.auth0lib;(e=c.isWidget?h.callbackify(f.reset,b,d,f):h.callbackify(f.changePassword,b,d,f))(a)},j.signout=function(){e.remove(),j.profile=null,j.profilePromise=null,j.idToken=null,j.state=null,j.accessToken=null,j.isAuthenticated=!1,l("logout")},j.getProfile=function(a){var b=h.promisify(c.auth0lib.getProfile,c.auth0lib);return j.profilePromise=b(a||j.idToken),j.profilePromise.then(function(a){return j.profile=a,a})},j}]}])}(); | ||
!function(){angular.module("auth0",["auth0.storage","auth0.service","auth0.interceptor","auth0.utils"]),angular.module("auth0.utils",[]).provider("authUtils",function(){var a={capitalize:function(a){return a?a.charAt(0).toUpperCase()+a.substring(1).toLowerCase():null},urlBase64Decode:function(a){var b=a.replace("-","+").replace("_","/");switch(b.length%4){case 0:break;case 2:b+="==";break;case 3:b+="=";break;default:throw"Illegal base64url string!"}return window.atob(b)}};angular.extend(this,a),this.$get=["$rootScope","$q",function(b,c){var d={};return angular.extend(d,a),d.safeApply=function(a){var c=b.$root.$$phase;"$apply"===c||"$digest"===c?a&&"function"==typeof a&&a():b.$apply(a)},d.callbackify=function(a,b,c,e){return angular.isFunction(a)?function(f){f=Array.prototype.slice.call(arguments);var g=function(a,d,e){return a?void(c&&c(a)):(e=Array.prototype.slice.call(arguments,1),void(b&&b.apply(null,e)))};f.push(d.applied(g)),a.apply(e,f)}:void 0},d.promisify=function(a,b){return angular.isFunction(a)?function(e){e=Array.prototype.slice.call(arguments);var f=c.defer(),g=function(a,b,c){return a?void f.reject(a):(c=Array.prototype.slice.call(arguments,1),void f.resolve(c.length>1?c:b))};return e.push(d.applied(g)),a.apply(b,e),f.promise.spread=f.promise.spread||function(a,b){return f.promise.then(function(b){return Array.isArray(b)?a.apply(null,b):a(b)},b)},f.promise}:void 0},d.applied=function(a){return function(b,c){b=b,c=c;var e=arguments;d.safeApply(function(){a.apply(null,e)})}},d}]}),angular.module("auth0.interceptor",[]).factory("authInterceptor",["$rootScope","$q","$injector",function(a,b,c){return{request:function(a){if(!c.has("auth"))return a;var b=c.get("auth");return a.headers=a.headers||{},b.idToken&&!a.headers.Authorization&&(a.headers.Authorization="Bearer "+b.idToken),a},responseError:function(c){return 401===c.status&&a.$broadcast("auth0.forbidden",c),b.reject(c)}}}]),angular.module("auth0.storage",[]).service("authStorage",["$injector",function(a){var b,c,d=null;if(localStorage)b=function(a,b){return localStorage.setItem(a,b)},c=function(a){return localStorage.getItem(a)},d=function(a){return localStorage.removeItem(a)};else{var e=a.get("$cookieStore");b=function(a,b){return e.put(a,b)},c=function(a){return e.get(a)},d=function(a){return e.remove(a)}}this.store=function(a,c,d,e){b("idToken",a),c&&b("accessToken",c),d&&b("state",d),e&&b("refreshToken",e)},this.get=function(){return{idToken:c("idToken"),accessToken:c("accessToken"),state:c("state"),refreshToken:c("refreshToken")}},this.remove=function(){d("idToken"),d("accessToken"),d("state"),d("refreshToken")}}]),angular.module("auth0.service",["auth0.storage","auth0.utils"]).provider("auth",["authUtilsProvider",function(a){var b={callbackOnLocationHash:!0},c=this;this.init=function(a,c){if(!c&&"undefined"==typeof Auth0Widget&&"undefined"==typeof Auth0)throw new Error("You must add either Auth0Widget.js or Auth0.js");if(!a)throw new Error("You must set options when calling init");this.loginUrl=a.loginUrl,this.loginState=a.loginState,this.clientID=a.clientID,this.sso=a.sso,this.minutesToRenewToken=a.minutesToRenewToken||120;var d=c;d||"undefined"==typeof Auth0Widget||(d=Auth0Widget),d||"undefined"==typeof Auth0||(d=Auth0),this.auth0lib=new d(angular.extend(b,a)),this.auth0lib.getClient?(this.auth0js=this.auth0lib.getClient(),this.isWidget=!0):(this.auth0js=this.auth0lib,this.isWidget=!1)},this.eventHandlers={},this.on=function(a,b){this.eventHandlers[a]||(this.eventHandlers[a]=[]),this.eventHandlers[a].push(b)};var d=["loginSuccess","loginFailure","logout","forbidden"];angular.forEach(d,function(b){c["add"+a.capitalize(b)+"Handler"]=function(a){c.on(b,a)}}),this.$get=["$rootScope","$q","$injector","authStorage","$window","$location","authUtils",function(a,b,d,e,f,g,h){function i(){e.remove(),c.loginUrl?g.path(c.loginUrl):c.loginState?d.get("$state").go(c.loginState):l("forbidden")}var j={isAuthenticated:!1},k=function(a){return c.eventHandlers[a]},l=function(a,b){angular.forEach(k(a)||[],function(a){d.invoke(a,j,b)})},m=function(a,b,c,d,f){e.store(a,b,c,d);var g=j.getProfile(a),h={idToken:a,accessToken:b,state:c,refreshToken:d,isAuthenticated:!0};return angular.extend(j,h),l("loginSuccess",angular.extend({profile:g,locationEvent:f},h)),g},n=null;a.$on("$locationChangeStart",function(a){var b=c.auth0lib.parseHash(f.location.hash);if(!j.isAuthenticated){if(b&&b.id_token)return void m(b.id_token,b.access_token,b.state,b.refresh_token,a);var d=e.get();if(d&&d.idToken){if(j.hasTokenExpired(d.idToken))return void(d.refreshToken?(n=j.refreshToken(d.refreshToken),n.then(function(b){m(b,d.accessToken,d.state,d.refreshToken,a)},function(){i()}).finally(function(){n=null})):i());var g=j.getTokenExpirationDate(d.idToken);return(new Date).valueOf()-g.valueOf()<=60*j.config.minutesToRenewToken*1e3&&j.renewIdToken(d.idToken).then(function(a){j.idToken=a}),void m(d.idToken,d.accessToken,d.state,d.refreshToken,a)}c.sso&&c.auth0js.getSSOData(h.applied(function(a,b){b.sso&&j.signin({popup:!1,connection:b.lastUsedConnection.strategy},c.auth0js)}))}}),a.$on("auth0.forbidden",function(){i()}),c.loginUrl&&a.$on("$routeChangeStart",function(a,b){b.$$route&&b.$$route.requiresLogin&&(j.isAuthenticated||n||g.path(c.loginUrl))}),c.loginState&&a.$on("$stateChangeStart",function(a,b){b.data&&b.data.requiresLogin&&(j.isAuthenticated||n||(a.preventDefault(),d.get("$state").go(c.loginState)))}),j.config=c;var o=function(a){var b=k("loginSuccess");if(!(a.popup||a.username&&a.email||b&&0!==b.length))throw new Error("You must define a loginSuccess handler if not using popup mode or not doing ro call because that means you are doing a redirect")};return j.hookEvents=function(){},j.getTokenExpirationDate=function(a){var b=a.split(".");if(3!==b.length)return!0;var c=h.urlBase64Decode(b[1]);if(!c)return!0;try{c=JSON.parse(c)}catch(d){return!0}if(!c.exp)return!0;var e=new Date(0);return e.setUTCSeconds(c.exp),e},j.hasTokenExpired=function(a){if(!a)return!0;var b=j.getTokenExpirationDate(a);return isNaN(b)?!0:b.valueOf()>(new Date).valueOf()?!1:!0},j.getToken=function(a){a=a||{scope:"openid"},a.id_token||a.refresh_token||(a.id_token=j.idToken);var b=h.promisify(c.auth0js.getDelegationToken,c.auth0js);return b(a).then(function(a){return a.id_token})},j.refreshToken=function(a){var b=h.promisify(c.auth0js.refreshToken,c.auth0js);return b(a||j.refreshToken).then(function(a){return a.id_token})},j.renewIdToken=function(a){var b=h.promisify(c.auth0js.renewIdToken,c.auth0js);return b(a||j.idToken).then(function(a){return a.id_token})},j.signin=function(a,b,d,e){a=a||{},o(a);var f=e||c.auth0lib,g=h.callbackify(f.signin,function(a,c,d,e,f){m(c,d,e,f).then(function(a){b&&b(a)})},function(a){l("loginFailure",{error:a}),d&&d(a)},f);c.isWidget?g(a,null):g(a)},j.signup=function(a,b,d){a=a||{},o(a);var e=c.auth0lib,f=h.callbackify(e.signup,function(c,d,e,f,g){angular.isUndefined(a.auto_login)||a.auto_login?m(d,e,f,g).then(function(a){b&&b(a)}):b()},function(a){l("loginFailure",{error:a}),d&&d(a)},e);c.isWidget?f(a,null):f(a)},j.reset=function(a,b,d){a=a||{};var e,f=c.auth0lib;(e=c.isWidget?h.callbackify(f.reset,b,d,f):h.callbackify(f.changePassword,b,d,f))(a)},j.signout=function(){e.remove(),j.profile=null,j.profilePromise=null,j.idToken=null,j.state=null,j.accessToken=null,j.isAuthenticated=!1,l("logout")},j.getProfile=function(a){var b=h.promisify(c.auth0lib.getProfile,c.auth0lib);return j.profilePromise=b(a||j.idToken),j.profilePromise.then(function(a){return j.profile=a,a})},j}]}])}(); |
# 2.2.X | ||
## 2.2.3 | ||
* Fixed bug with email not recognized as possible parameter to do /ro | ||
## 2.2.2 | ||
* Small BugFix for Refresh Token | ||
## 2.2.0 | ||
@@ -4,0 +10,0 @@ * Default storage service is now `localStorage`. It can fallback to `ngCookies`. More info [here](https://github.com/auth0/auth0-angular/blob/master/docs/custom-storage.md) |
@@ -313,2 +313,4 @@ (function () { | ||
forbidden(); | ||
}).finally(function () { | ||
refreshingToken = null; | ||
}); | ||
@@ -368,3 +370,3 @@ } else { | ||
var successHandlers = getHandlers('loginSuccess'); | ||
if (!options.popup && !options.username && (!successHandlers || successHandlers.length === 0)) { | ||
if (!options.popup && (!options.username || !options.email) && (!successHandlers || successHandlers.length === 0)) { | ||
throw new Error('You must define a loginSuccess handler ' + 'if not using popup mode or not doing ro call because that means you are doing a redirect'); | ||
@@ -371,0 +373,0 @@ } |
@@ -313,2 +313,4 @@ (function () { | ||
forbidden(); | ||
}).finally(function () { | ||
refreshingToken = null; | ||
}); | ||
@@ -368,3 +370,3 @@ } else { | ||
var successHandlers = getHandlers('loginSuccess'); | ||
if (!options.popup && !options.username && (!successHandlers || successHandlers.length === 0)) { | ||
if (!options.popup && (!options.username || !options.email) && (!successHandlers || successHandlers.length === 0)) { | ||
throw new Error('You must define a loginSuccess handler ' + 'if not using popup mode or not doing ro call because that means you are doing a redirect'); | ||
@@ -371,0 +373,0 @@ } |
@@ -313,2 +313,4 @@ (function () { | ||
forbidden(); | ||
}).finally(function () { | ||
refreshingToken = null; | ||
}); | ||
@@ -368,3 +370,3 @@ } else { | ||
var successHandlers = getHandlers('loginSuccess'); | ||
if (!options.popup && !options.username && (!successHandlers || successHandlers.length === 0)) { | ||
if (!options.popup && (!options.username || !options.email) && (!successHandlers || successHandlers.length === 0)) { | ||
throw new Error('You must define a loginSuccess handler ' + 'if not using popup mode or not doing ro call because that means you are doing a redirect'); | ||
@@ -371,0 +373,0 @@ } |
@@ -313,2 +313,4 @@ (function () { | ||
forbidden(); | ||
}).finally(function () { | ||
refreshingToken = null; | ||
}); | ||
@@ -368,3 +370,3 @@ } else { | ||
var successHandlers = getHandlers('loginSuccess'); | ||
if (!options.popup && !options.username && (!successHandlers || successHandlers.length === 0)) { | ||
if (!options.popup && (!options.username || !options.email) && (!successHandlers || successHandlers.length === 0)) { | ||
throw new Error('You must define a loginSuccess handler ' + 'if not using popup mode or not doing ro call because that means you are doing a redirect'); | ||
@@ -371,0 +373,0 @@ } |
@@ -313,2 +313,4 @@ (function () { | ||
forbidden(); | ||
}).finally(function () { | ||
refreshingToken = null; | ||
}); | ||
@@ -368,3 +370,3 @@ } else { | ||
var successHandlers = getHandlers('loginSuccess'); | ||
if (!options.popup && !options.username && (!successHandlers || successHandlers.length === 0)) { | ||
if (!options.popup && (!options.username || !options.email) && (!successHandlers || successHandlers.length === 0)) { | ||
throw new Error('You must define a loginSuccess handler ' + 'if not using popup mode or not doing ro call because that means you are doing a redirect'); | ||
@@ -371,0 +373,0 @@ } |
@@ -313,2 +313,4 @@ (function () { | ||
forbidden(); | ||
}).finally(function () { | ||
refreshingToken = null; | ||
}); | ||
@@ -368,3 +370,3 @@ } else { | ||
var successHandlers = getHandlers('loginSuccess'); | ||
if (!options.popup && !options.username && (!successHandlers || successHandlers.length === 0)) { | ||
if (!options.popup && (!options.username || !options.email) && (!successHandlers || successHandlers.length === 0)) { | ||
throw new Error('You must define a loginSuccess handler ' + 'if not using popup mode or not doing ro call because that means you are doing a redirect'); | ||
@@ -371,0 +373,0 @@ } |
@@ -313,2 +313,4 @@ (function () { | ||
forbidden(); | ||
}).finally(function () { | ||
refreshingToken = null; | ||
}); | ||
@@ -368,3 +370,3 @@ } else { | ||
var successHandlers = getHandlers('loginSuccess'); | ||
if (!options.popup && !options.username && (!successHandlers || successHandlers.length === 0)) { | ||
if (!options.popup && (!options.username || !options.email) && (!successHandlers || successHandlers.length === 0)) { | ||
throw new Error('You must define a loginSuccess handler ' + 'if not using popup mode or not doing ro call because that means you are doing a redirect'); | ||
@@ -371,0 +373,0 @@ } |
@@ -7,3 +7,3 @@ require.config({ | ||
'auth-angular': './auth0-angular', | ||
'auth0': '//cdn.auth0.com/w2/auth0-3.1' | ||
'auth0': '//cdn.auth0.com/w2/auth0-4' | ||
}, | ||
@@ -10,0 +10,0 @@ shim: { |
@@ -313,2 +313,4 @@ (function () { | ||
forbidden(); | ||
}).finally(function () { | ||
refreshingToken = null; | ||
}); | ||
@@ -368,3 +370,3 @@ } else { | ||
var successHandlers = getHandlers('loginSuccess'); | ||
if (!options.popup && !options.username && (!successHandlers || successHandlers.length === 0)) { | ||
if (!options.popup && (!options.username || !options.email) && (!successHandlers || successHandlers.length === 0)) { | ||
throw new Error('You must define a loginSuccess handler ' + 'if not using popup mode or not doing ro call because that means you are doing a redirect'); | ||
@@ -371,0 +373,0 @@ } |
@@ -313,2 +313,4 @@ (function () { | ||
forbidden(); | ||
}).finally(function () { | ||
refreshingToken = null; | ||
}); | ||
@@ -368,3 +370,3 @@ } else { | ||
var successHandlers = getHandlers('loginSuccess'); | ||
if (!options.popup && !options.username && (!successHandlers || successHandlers.length === 0)) { | ||
if (!options.popup && (!options.username || !options.email) && (!successHandlers || successHandlers.length === 0)) { | ||
throw new Error('You must define a loginSuccess handler ' + 'if not using popup mode or not doing ro call because that means you are doing a redirect'); | ||
@@ -371,0 +373,0 @@ } |
@@ -313,2 +313,4 @@ (function () { | ||
forbidden(); | ||
}).finally(function () { | ||
refreshingToken = null; | ||
}); | ||
@@ -368,3 +370,3 @@ } else { | ||
var successHandlers = getHandlers('loginSuccess'); | ||
if (!options.popup && !options.username && (!successHandlers || successHandlers.length === 0)) { | ||
if (!options.popup && (!options.username || !options.email) && (!successHandlers || successHandlers.length === 0)) { | ||
throw new Error('You must define a loginSuccess handler ' + 'if not using popup mode or not doing ro call because that means you are doing a redirect'); | ||
@@ -371,0 +373,0 @@ } |
@@ -313,2 +313,4 @@ (function () { | ||
forbidden(); | ||
}).finally(function () { | ||
refreshingToken = null; | ||
}); | ||
@@ -368,3 +370,3 @@ } else { | ||
var successHandlers = getHandlers('loginSuccess'); | ||
if (!options.popup && !options.username && (!successHandlers || successHandlers.length === 0)) { | ||
if (!options.popup && (!options.username || !options.email) && (!successHandlers || successHandlers.length === 0)) { | ||
throw new Error('You must define a loginSuccess handler ' + 'if not using popup mode or not doing ro call because that means you are doing a redirect'); | ||
@@ -371,0 +373,0 @@ } |
{ | ||
"name": "auth0-angular", | ||
"version": "2.2.1", | ||
"version": "2.2.3", | ||
"main": "./build/auth0-angular.js", | ||
@@ -5,0 +5,0 @@ "devDependencies": { |
@@ -38,2 +38,4 @@ # Auth0 and AngularJS | ||
> **Warning**: If you use a CDN or get the script manually, please be sure to include `auth0-widget` or `auth0.js` that matches the versions [specified on the `bower.json`](https://github.com/auth0/auth0-angular/blob/master/bower.json#L7-L8) | ||
## TL;DR: Quick start guide | ||
@@ -40,0 +42,0 @@ |
@@ -316,2 +316,4 @@ (function () { | ||
forbidden(); | ||
}).finally(function() { | ||
refreshingToken = null; | ||
}); | ||
@@ -382,3 +384,3 @@ } else { | ||
var successHandlers = getHandlers('loginSuccess'); | ||
if (!options.popup && !options.username && (!successHandlers || successHandlers.length === 0)) { | ||
if (!options.popup && (!options.username || !options.email) && (!successHandlers || successHandlers.length === 0)) { | ||
throw new Error('You must define a loginSuccess handler ' + | ||
@@ -385,0 +387,0 @@ 'if not using popup mode or not doing ro call because that means you are doing a redirect'); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
553397
9051
441