Everything seems to be working fine in my application, but I am encountering the following error message:
The argument of type 'Object' is causing an issue and cannot be assigned to a parameter of type 'string'
Here is the code snippet where the error occurs:
public login(userData: any): Observable<any> {
return this.http
.post("/api/users/login", userData)
.map(token => this.saveToken(token));
}
private saveToken(token: string): string {
localStorage.setItem("car_auth", token);
return token;
}