token = this.auth.getToken() // auth is provided via constructor. | |
if (token) { | |
// Logged in. Add Bearer token. | |
return next.handle( | |
req.clone({ | |
headers: req.headers.append('Authorization', 'Bearer ' + token) | |
}) | |
); | |
} | |
// Not logged in. Continue without modification. | |
return next.handle(req); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment