Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
token = this.auth.getToken() // auth is provided via constructor.
if (token) {
// Logged in. Add Bearer token.
return next.handle(
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