SHARE
TWEET

Untitled

a guest Dec 22nd, 2017 18 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. login(credentials: Credentials): Observable<any> {
  2.     const result = this.apiAuthService.login(credentials)
  3.       .map(response => {
  4.         this.username = credentials.username
  5.         this.token = response['id']
  6.         this.userId = response['userId']
  7.       }).concatMap(response =>{
  8.         return this.getUserRoleMapping(this.userId).map(res =>{
  9.           return res
  10.         })
  11.       }).concatMap((res)=>{
  12.       console.log(res)
  13.           console.log('return the getRealRol',this.getRealRol(res[0].roleId))
  14.           return this.getRealRol(res[0].roleId).map(info =>{
  15.             return info
  16.           })
  17.     }).concatMap((info)=>{
  18.       this.userRol = info.name
  19.       this.setStorageToken(this.userId, this.token, this.userRol)
  20.     })
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top