Open
Description
Actually, the solution shown in the video is incorrect since we have protected the route /api/v1/customers
We need to add a token each time we request. There should be something like the following:
findAll(): Observable<CustomerDto[]> {
return this.http.get<CustomerDto[]>(
"http://localhost:8080/api/v1/customers", {
headers: new HttpHeaders({
"Authorization": `Bearer ${localStorage.getItem("token")}`
})
}
);
}
Metadata
Assignees
Labels
No labels
Activity