Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public login(user: string, password: string): Observable<any> {
- const body = new HttpParams()
- .set(`grant_type`, `password`)
- .set(`username`, user)
- .set(`password`, password);
- const headers = new HttpHeaders({
- 'Content-Type': `application/x-www-form-urlencoded`,
- 'Authorization': `Basic Y2xpZW50OnNlY3JldA==`})
- return this.http.post(api+`oauth/token`, body.toString(), { headers: headers, withCredentials: true })
- .pipe(
- map((res: any) => res)
- , catchError((err: any) => {throw(err)})
- )
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement