Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- login(email: string, password: string): Observable<any> {
- const body = `username=${encodeURIComponent(email)}&password=${encodeURIComponent(password)}&grant_type=password`;
- let headers = new HttpHeaders();
- headers = headers.append('Content-Type', 'application/x-www-form-urlencoded')
- .append('Authorization', 'Basic ' + btoa(TOKEN_AUTH_USERNAME + ':' + TOKEN_AUTH_PASSWORD));
- return this.http.post<any>(AUTH_API_URL, body, {headers: headers, observe: 'response'});
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement