Ghost/ghost/admin/mirage/config/config.js
Kevin Ansfield 457a8e2955 🎨 Added auto-login to private site when viewing site preview in admin (#1286)
closes https://github.com/TryGhost/Ghost/issues/10995

- when first loading the site preview, if private mode is enabled submit the login form in the background to get the cookie before loading the iframe
- refactors post-authentication preloading to ensure it occurs before post-authentication route hooks are called
- adds `showSuccess` attribute to `<GhTaskButton>` so that when set to `false` it can stay in the running state after "success" to avoid state change flashes whilst waiting for a transition
2019-08-12 09:11:10 +01:00

14 lines
296 B
JavaScript

import {isEmpty} from '@ember/utils';
export default function mockConfig(server) {
server.get('/config/', function ({db}) {
if (isEmpty(db.configs)) {
server.loadFixtures('configs');
}
return {
config: db.configs.find(1)
};
});
}