diff --git a/app/controllers/register.js b/app/controllers/register.js index ab1b1cb8cd1..7a071a7b713 100644 --- a/app/controllers/register.js +++ b/app/controllers/register.js @@ -22,11 +22,7 @@ export default class RegisterController extends Controller { this.model.save() .then(user => { this.set('session.newUser', user.get('email')); - if (this.inviteToken) { this.send('loginExistingUser', user.get('email'), password, this.inviteToken, this.event); - } else { - this.transitionToRoute('login'); - } }) .catch(reason => { if (reason && Object.prototype.hasOwnProperty.call(reason, 'errors') && reason.errors[0].status === 409) { @@ -60,7 +56,11 @@ export default class RegisterController extends Controller { await this.store.findRecord('user', tokenPayload.identity) ); } - this.transitionToRoute('public.role-invites', eventId, { queryParams: { token } }); + if (token) { + this.transitionToRoute('public.role-invites', eventId, { queryParams: { token } }); + } else { + this.transitionToRoute('/'); + } }) .catch(reason => { if (!(this.isDestroyed || this.isDestroying)) {