Guest User

Untitled

a guest
Jul 8th, 2018
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. logIn(username: string, password: string): any {
  2. return this.http.post<User>(this.API.LOGIN, { username, password });
  3. }
  4.  
  5. LogIn: Observable<any> = this.actions
  6. .ofType<any>(AuthActionTypes.LOGIN)
  7. .map((action: LogIn) => action.payload)
  8. .exhaustMap(payload => {
  9. return this.authService.logIn(payload.username, payload.password).pipe(
  10. map(user => {
  11. return new LogInSuccess({
  12. username: user,
  13. });
  14. }),
  15. catchError(error => console.log(error)),
  16. );
  17. });
Add Comment
Please, Sign In to add comment