Skip to content

Commit

Permalink
Remove autologin after registeration success
Browse files Browse the repository at this point in the history
  • Loading branch information
MurhafSousli committed Jul 24, 2017
1 parent e1ce96e commit f5513b0
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/auth/effects/auth.effects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,15 @@ export class AuthEffects {
@Effect({dispatch: false})
registerSuccess$ = this.actions$
.ofType(Auth.REGISTER_SUCCESS)
.map((action: Auth.Register) => action.payload)
.map((form: RegisterForm) => <Authenticate>{username: form.email, password: form.password})
.map((cred: Authenticate) => new Auth.Login(cred));
.do(() => {

const alert = this.alerts.create({
title: 'Success',
message: 'Your account request will be reviewed by the admin.',
buttons: ['OK']
});
alert.present();
});


/** Login/Register Fail */
Expand Down

0 comments on commit f5513b0

Please sign in to comment.