Re: [AngularJS] Attach Authorization Bearer JWT token for each API call

2016-08-26 Thread Kyle Thomas
Thanks Lucas, that worked perfectly! On Friday, August 26, 2016 at 11:52:59 AM UTC-5, Lucas Lacroix wrote: > > I had a similar question and never found a good answer. > I ended up creating my own service which is just a wrapper around the HTTP > service. It's a bit of boiler plate, but it works.

Re: [AngularJS] Attach Authorization Bearer JWT token for each API call

2016-08-26 Thread 'Lucas Lacroix' via AngularJS
I had a similar question and never found a good answer. I ended up creating my own service which is just a wrapper around the HTTP service. It's a bit of boiler plate, but it works. Additionally, because I'm using OAuth2 tokens instead of JWT, I was able to add in the functionality of renewing the

[AngularJS] Attach Authorization Bearer JWT token for each API call

2016-08-26 Thread Kyle Thomas
Is there a way to attach the Bearer token for each /api/ call out through something similar to an $httpProvider.interceptors in Angular 1? Right now I'm attaching it at every function call getUsers() { let jwt = Cookie.get('token'); let authHeader = new Headers(); if