Redirect signin if authenticated

closes #3147
- added beforeModel redirect
- added test
This commit is contained in:
Sebastian Gierlinger 2014-07-01 11:21:05 +02:00
parent c91f062d3e
commit 484e5d39e1

View File

@ -3,6 +3,11 @@ import loadingIndicator from 'ghost/mixins/loading-indicator';
var SigninRoute = Ember.Route.extend(styleBody, loadingIndicator, {
classNames: ['ghost-login'],
beforeModel: function () {
if (this.get('session').isAuthenticated) {
this.transitionTo(Ember.SimpleAuth.routeAfterAuthentication);
}
},
actions: {
sessionAuthenticationFailed: function (error) {
this.notifications.showError(error.message);