Comparing version 0.1.7 to 0.1.8
{ | ||
"name": "co-auther", | ||
"version": "0.1.7", | ||
"version": "0.1.8", | ||
"description": "", | ||
@@ -11,4 +11,4 @@ "main": "src/co-auther/co-auther.js", | ||
"test-e2e": "npm run build && gulp test-e2e", | ||
"typescript": "tsc -p .", | ||
"watch": "tsc -p . -w", | ||
"typescript": "tsc", | ||
"watch": "tsc -w", | ||
"sass": "gulp sass", | ||
@@ -32,4 +32,4 @@ "typings": "typings", | ||
"protractor": "3.1.1", | ||
"typescript": "1.8.10", | ||
"typings": "0.8.1" | ||
"typescript": "1.9.0-dev.20160409", | ||
"typings": "1.0.5" | ||
}, | ||
@@ -43,2 +43,3 @@ "dependencies": { | ||
"@angular/platform-browser-dynamic": "2.0.0-rc.1", | ||
"@angular/router": "^3.0.0-alpha.3", | ||
"@angular/router-deprecated": "^2.0.0-rc.1", | ||
@@ -45,0 +46,0 @@ "es6-shim": "0.35.0", |
@@ -31,5 +31,5 @@ "use strict"; | ||
var initialRequestPending = false; | ||
function activationHelper(currentPage) { | ||
function activationHelper(destinationRequested) { | ||
var canActivate = false; | ||
var destinationRoute = null; | ||
var destinationResult = null; | ||
var authData = getCoAuther().getAuthData(); | ||
@@ -39,12 +39,12 @@ var initialDataLoaded = getCoAuther().isInitialDataLoaded(); | ||
// authData and initialRequest done, you are logged in | ||
destinationRoute = config.LOGGED_IN; | ||
canActivate = currentPage === destinationRoute; | ||
destinationResult = config.LOGGED_IN; | ||
canActivate = destinationRequested === destinationResult; | ||
} | ||
else if (!authData) { | ||
destinationRoute = config.AUTHENTICATE; | ||
canActivate = currentPage === destinationRoute; | ||
else if (!authData && !initialRequestPending) { | ||
destinationResult = config.AUTHENTICATE; | ||
canActivate = destinationRequested === destinationResult; | ||
} | ||
else { | ||
destinationRoute = config.INITIAL_REQUEST; | ||
canActivate = currentPage === destinationRoute; | ||
destinationResult = config.INITIAL_REQUEST; | ||
canActivate = destinationRequested === destinationResult; | ||
if (!initialRequestPending && !initialRequestFailed) { | ||
@@ -61,3 +61,3 @@ initialRequestPending = true; | ||
}) | ||
.catch(function () { | ||
.catch(function (err) { | ||
// initial request failed, clear auth data from login and go to authenticate | ||
@@ -75,3 +75,3 @@ initialRequestPending = false; | ||
if (!canActivate) { | ||
return routeFunction(destinationRoute); | ||
return routeFunction(destinationResult); | ||
} | ||
@@ -78,0 +78,0 @@ return canActivate; |
@@ -30,5 +30,5 @@ let dontTouchLocalStorage = true | ||
var initialRequestPending = false | ||
function activationHelper (currentPage): any { | ||
function activationHelper (destinationRequested): any { | ||
let canActivate = false | ||
let destinationRoute = null | ||
let destinationResult = null | ||
let authData = getCoAuther().getAuthData() | ||
@@ -38,10 +38,10 @@ let initialDataLoaded = getCoAuther().isInitialDataLoaded() | ||
// authData and initialRequest done, you are logged in | ||
destinationRoute = config.LOGGED_IN | ||
canActivate = currentPage === destinationRoute | ||
} else if (!authData) { | ||
destinationRoute = config.AUTHENTICATE | ||
canActivate = currentPage === destinationRoute | ||
destinationResult = config.LOGGED_IN | ||
canActivate = destinationRequested === destinationResult | ||
} else if (!authData && !initialRequestPending) { | ||
destinationResult = config.AUTHENTICATE | ||
canActivate = destinationRequested === destinationResult | ||
} else { | ||
destinationRoute = config.INITIAL_REQUEST | ||
canActivate = currentPage === destinationRoute | ||
destinationResult = config.INITIAL_REQUEST | ||
canActivate = destinationRequested === destinationResult | ||
if (!initialRequestPending && !initialRequestFailed) { | ||
@@ -58,3 +58,3 @@ initialRequestPending = true | ||
}) | ||
.catch(() => { | ||
.catch((err) => { | ||
// initial request failed, clear auth data from login and go to authenticate | ||
@@ -72,3 +72,3 @@ initialRequestPending = false | ||
if (!canActivate) { | ||
return routeFunction(destinationRoute) | ||
return routeFunction(destinationResult) | ||
} | ||
@@ -128,3 +128,3 @@ return canActivate | ||
function initialize (apiService, newConfig, newRouteFunction) { | ||
function initialize (apiService, newConfig, newRouteFunction?) { | ||
coAuther = CoAuther(apiService) | ||
@@ -131,0 +131,0 @@ if (newConfig.authData) { |
{ | ||
"ambientDependencies": { | ||
"es6-shim": "registry:dt/es6-shim#0.31.2+20160317120654", | ||
"jasmine": "registry:dt/jasmine#2.2.0+20160412134438" | ||
"globalDependencies": { | ||
"es6-shim": "registry:dt/es6-shim#0.31.2+20160602141504", | ||
"jasmine": "registry:dt/jasmine#2.2.0+20160505161446" | ||
} | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
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
212924
107
5618
13
+ Added@angular/router@3.4.10(transitive)