mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-13 22:41:32 -05:00
725d4aac7d
No Issue - Move authentication related handlers to the Application route. - Switch Sign Out from a button to a link. Use the signout route to handle invalidating the session and redirecting instead of an action from a button. - Clear error messages on signin page when pressing log in button. - Errors are now always shown on sign in screen and a success notification is shown after sign out. - Update functional tests.
19 lines
627 B
JavaScript
19 lines
627 B
JavaScript
import styleBody from 'ghost/mixins/style-body';
|
|
import loadingIndicator from 'ghost/mixins/loading-indicator';
|
|
|
|
var SignoutRoute = Ember.Route.extend(SimpleAuth.AuthenticatedRouteMixin, styleBody, loadingIndicator, {
|
|
classNames: ['ghost-signout'],
|
|
|
|
afterModel: function (model, transition) {
|
|
if (Ember.canInvoke(transition, 'send')) {
|
|
transition.send('invalidateSession');
|
|
transition.abort();
|
|
this.transitionTo('signin');
|
|
} else {
|
|
this.send('invalidateSession');
|
|
this.transitionTo('signin');
|
|
}
|
|
}
|
|
});
|
|
|
|
export default SignoutRoute;
|