Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Addition of basic support for ember-mu-login. #5

Merged
merged 21 commits into from
Jul 6, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
4 changes: 0 additions & 4 deletions app/routes/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,4 @@ import { inject as service } from '@ember/service';

export default class ApplicationRoute extends Route {
@service session;

activate(transition) {

}
}
6 changes: 6 additions & 0 deletions app/routes/errors.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@ import Route from '@ember/routing/route';
import DataTableRouteMixin from 'ember-data-table/mixins/route';
import { action } from '@ember/object';
import { tracked } from '@glimmer/tracking';
import { inject as service } from '@ember/service';

export default class ErrorsRoute extends Route.extend(DataTableRouteMixin) {
modelName = 'log-entry';
@tracked isLoading = false;
@service session;

queryParams = {
logLevelId: { refreshModel: true },
Expand All @@ -14,6 +16,10 @@ export default class ErrorsRoute extends Route.extend(DataTableRouteMixin) {
logDateTo: { refreshModel: true },
};

beforeModel(transition) {
this.session.requireAuthentication(transition, 'login');
}

@action
loading(transition /*, route*/) {
//This used to be on the controller, but accessing a controller shouldn't be done outside the setupController method.
Expand Down
4 changes: 0 additions & 4 deletions app/routes/login.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,4 @@ export default class LoginRoute extends Route {
refreshModel: true,
},
};

beforeModel() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this should have been removed

this.session.prohibitAuthentication('index');
}
}
7 changes: 7 additions & 0 deletions app/routes/reports.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
import Route from '@ember/routing/route';
import DataTableRouteMixin from 'ember-data-table/mixins/route';
import { inject as service } from '@ember/service';

export default class IndexRoute extends Route.extend(DataTableRouteMixin) {
@service session;

beforeModel(transition) {
this.session.requireAuthentication(transition, 'login');
}

modelName = 'report';
queryParams = {
page: { refreshModel: true },
Expand Down