-1

enter image description here

I am getting an error like this. Couldn't find the solution.

enter image description here

  login(signInRequestPayload: SignInRequestPayload): Observable<boolean> {
return this.httpClient.post<SignInResponse>( '/api/v1/registration/login', signInRequestPayload)
  .pipe(map(data => {
    this.localStorage.store('token', data.token);
    return true;
  }));

}

Drenai
  • 11,315
  • 9
  • 48
  • 82
  • 1
    Please paste your error messages/code/JSON as text. It appears that your api is returning something which can't be mapped to a `SignInResponse`. – Hopey One Mar 27 '21 at 23:03

1 Answers1

1

You might be receiving text as the response type, but by default Angular expects JSON. Try setting {responseType: 'text'} in the options of the call

Drenai
  • 11,315
  • 9
  • 48
  • 82