2014-03-09 22:44:08 -05:00
|
|
|
import styleBody from 'ghost/mixins/style-body';
|
2014-06-04 22:18:23 -05:00
|
|
|
import loadingIndicator from 'ghost/mixins/loading-indicator';
|
2014-03-09 22:44:08 -05:00
|
|
|
|
2014-06-04 22:18:23 -05:00
|
|
|
var SignupRoute = Ember.Route.extend(styleBody, loadingIndicator, {
|
2014-07-03 10:06:07 -05:00
|
|
|
classNames: ['ghost-signup'],
|
|
|
|
beforeModel: function () {
|
|
|
|
if (this.get('session').isAuthenticated) {
|
|
|
|
this.transitionTo(Ember.SimpleAuth.routeAfterAuthentication);
|
|
|
|
}
|
|
|
|
},
|
|
|
|
setupController: function (controller, params) {
|
|
|
|
var tokenText = atob(params.token),
|
|
|
|
email = tokenText.split('|')[1];
|
|
|
|
controller.token = params.token;
|
|
|
|
controller.email = email;
|
|
|
|
controller.name = email.substring(0, email.indexOf('@'));
|
|
|
|
}
|
2014-03-09 22:44:08 -05:00
|
|
|
});
|
|
|
|
|
|
|
|
export default SignupRoute;
|