Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions app/routes/identity.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,6 @@ export default class IdentityRoute extends Route {
@service login;
@service fastboot;

beforeModel(transition) {
if (transition?.to?.queryParams?.dev !== 'true') {
this.router.transitionTo('/page-not-found');
}
}

async model() {
if (this.fastboot.isFastBoot) {
return null;
Expand Down
29 changes: 0 additions & 29 deletions tests/unit/routes/identity-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,35 +25,6 @@ module('Unit | Route | identity', function (hooks) {
assert.ok(this.route);
});

test('beforeModel redirects to page-not-found when dev param is not true', function (assert) {
const transition = {
to: {
queryParams: {
dev: 'false',
},
},
};

this.route.beforeModel(transition);
assert.ok(
this.route.router.transitionTo.calledWith('/page-not-found'),
'should redirect to page-not-found',
);
});

test('beforeModel allows navigation when dev param is true', function (assert) {
const transition = {
to: {
queryParams: {
dev: 'true',
},
},
};

this.route.beforeModel(transition);
assert.notOk(this.route.router.transitionTo.called, 'should not redirect');
});

test('model returns null in FastBoot', async function (assert) {
this.route.fastboot.isFastBoot = true;
const result = await this.route.model();
Expand Down