Skip to content

Commit

Permalink
fix: remove intermidiate step of login while registering (#5504)
Browse files Browse the repository at this point in the history
Co-authored-by: Areeb Jamal <jamal.areeb@gmail.com>
  • Loading branch information
maze-runnar and iamareebjamal authored Nov 6, 2020
1 parent 79e0cbd commit 3f16789
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions app/controllers/register.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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)) {
Expand Down

1 comment on commit 3f16789

@vercel
Copy link

@vercel vercel bot commented on 3f16789 Nov 6, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.