Skip to content
This repository was archived by the owner on Nov 25, 2020. It is now read-only.

Commit

Permalink
fix(project): use auth:true for authenticationStep and isAuth
Browse files Browse the repository at this point in the history
  • Loading branch information
doktordirk committed Jun 2, 2016
1 parent 9c24a43 commit caf4a3b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/authenticateStep.js
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
Expand Down
2 changes: 1 addition & 1 deletion src/authorizeStep.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
16 changes: 8 additions & 8 deletions test/authenticateStep.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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', () => {
Expand Down

0 comments on commit caf4a3b

Please sign in to comment.