angular-11-spring-boot-jwt-authentication icon indicating copy to clipboard operation
angular-11-spring-boot-jwt-authentication copied to clipboard

"auth-token" null in SessionStorage

Open cosad3s opened this issue 4 years ago • 0 comments

Hello,

I have seen a little error for the "auth-token" SessionStorage.

In frontend (File login.component.ts):

    this.authService.login(username, password).subscribe(
      data => {
        this.tokenStorage.saveToken(data.accessToken);
        this.tokenStorage.saveUser(data);

In backend (File JwtResponse.java):

@Data
public class JwtResponse {
	private String token;
	private String type = "Bearer";

So, in frontend accessToken should be changed to token (Or in backend change token to accessToken).

cosad3s avatar Nov 29 '21 07:11 cosad3s