mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-01 22:02:11 +03:00
457a8e2955
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
19 lines
561 B
JavaScript
19 lines
561 B
JavaScript
import SessionService from 'ember-simple-auth/services/session';
|
|
import {computed} from '@ember/object';
|
|
import {inject as service} from '@ember/service';
|
|
|
|
export default SessionService.extend({
|
|
dataStore: service('store'), // SessionService.store already exists
|
|
|
|
user: computed(function () {
|
|
return this.dataStore.queryRecord('user', {id: 'me'});
|
|
}),
|
|
|
|
authenticate() {
|
|
// ensure any cached this.user value is removed and re-fetched
|
|
this.notifyPropertyChange('user');
|
|
|
|
return this._super(...arguments);
|
|
}
|
|
});
|