Permalink
Browse files

fix(project): use auth:true for authenticationStep and isAuth

  • Loading branch information...
doktordirk committed Jun 2, 2016
1 parent 9c24a43 commit caf4a3bea8a3e6d9d33fe65d25f67fdd217a2259
Showing with 10 additions and 10 deletions.
  1. +1 −1 src/authenticateStep.js
  2. +1 −1 src/authorizeStep.js
  3. +8 −8 test/authenticateStep.spec.js
@@ -12,7 +12,7 @@ export class AuthenticateStep {
const isLoggedIn = this.authService.authenticated;
const loginRoute = this.authService.config.loginRoute;
if (routingContext.getAllInstructions().some(route => route.config.settings.authenticate === true)) {
if (routingContext.getAllInstructions().some(route => route.config.auth === true)) {
if (!isLoggedIn) {
return next.cancel(new Redirect(loginRoute));
}
@@ -6,7 +6,7 @@ import {AuthService} from './authService';
@inject(AuthService)
export class AuthorizeStep {
constructor(authService) {
LogManager.getLogger('authentication').warn('AuthorizeStep is deprecated. Use AuthenticationStep instead and use {settings: {authenticate: true}} in your route configuration.');
LogManager.getLogger('authentication').warn('AuthorizeStep is deprecated. Use AuthenticationStep instead.');
this.authService = authService;
}
@@ -5,20 +5,20 @@ import {AuthenticateStep} from '../src/authenticateStep';
const routes = {
onLoginRoute : [
{name: 'parent', fragment: '/login', config: {settings: {}}},
{name: 'child', fragment: 'childUrl', config: {settings: {}}}
{name: 'parent', fragment: '/login', config: {}},
{name: 'child', fragment: 'childUrl', config: {}}
],
authenticateNone : [
{name: 'parent', fragment: 'parentUrl', config: {settings: {}}},
{name: 'child', fragment: 'childUrl', config: {settings: {}}}
{name: 'parent', fragment: 'parentUrl', config: {}},
{name: 'child', fragment: 'childUrl', config: {}}
],
authenticateChild : [
{name: 'parent', fragment: 'parentUrl', config: {settings: {}}},
{name: 'child', fragment: 'childUrl', config: {settings: {authenticate: true}}}
{name: 'parent', fragment: 'parentUrl', config: {}},
{name: 'child', fragment: 'childUrl', config: {auth: true}}
],
authenticateParent : [
{name: 'parent', fragment: 'parentUrl', config: {settings: {authenticate: true}}},
{name: 'child', fragment: 'childUrl', config: {settings: {}}}
{name: 'parent', fragment: 'parentUrl', config: {auth: true}},
{name: 'child', fragment: 'childUrl', config: {}}
]};
describe('AuthenticateStep', () => {

0 comments on commit caf4a3b

Please sign in to comment.