Viewing entries tagged
authentication

Angular 7 Authenticated Route Guard

Comment

Angular 7 Authenticated Route Guard

In this post we’ll add a route guard that only allows the user to navigate to the /beer route if they’re authenticated. The new AuthRouteGuard will determine if the user is authenticated via a NGRX store using a selector that checks for the existence of a JWT.

Comment

Add JWT Token to Angular HTTP Requests Using NGRX

Comment

Add JWT Token to Angular HTTP Requests Using NGRX

It’s become pretty commonplace to authenticate and authorize web clients using JWTs (JSON Web Tokens) via HTTP request headers; it’s also become fairly popular to leverage some form of state management in web clients with a flavor of Redux. In this post I’ve created a simple web client with Angular CLI and NGRX that demonstrates how to retrieve a saved JWT from a NGRX store and apply it to all API requests using an HTTP interceptor.

Comment