mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-28 14:03:48 +03:00
2332f339dc
closes https://linear.app/tryghost/issue/IPC-136/setupdone-route-500s-if-you-hit-it-from-a-logged-out-state-instead-of - the setup/done route was not set up as an authenticated route so no redirect occurred when accessing it directly before logging in which in turn caused an error because the route tries to read from the session user
35 lines
919 B
JavaScript
35 lines
919 B
JavaScript
import AuthenticatedRoute from 'ghost-admin/routes/authenticated';
|
|
import {inject as service} from '@ember/service';
|
|
|
|
export default class SetupFinishingTouchesRoute extends AuthenticatedRoute {
|
|
@service feature;
|
|
@service onboarding;
|
|
@service router;
|
|
@service session;
|
|
@service settings;
|
|
@service themeManagement;
|
|
|
|
beforeModel() {
|
|
super.beforeModel(...arguments);
|
|
|
|
if (!this.session.user.isOwnerOnly) {
|
|
return;
|
|
}
|
|
|
|
if (this.feature.onboardingChecklist) {
|
|
this.onboarding.startChecklist();
|
|
return this.router.transitionTo('dashboard');
|
|
}
|
|
}
|
|
|
|
model() {
|
|
this.themeManagement.setPreviewType('homepage');
|
|
this.themeManagement.updatePreviewHtmlTask.perform();
|
|
}
|
|
|
|
deactivate() {
|
|
// rollback any unsaved setting changes when leaving
|
|
this.settings.rollbackAttributes();
|
|
}
|
|
}
|