angular-auth icon indicating copy to clipboard operation
angular-auth copied to clipboard

I am using oauth2 api.

Open ghost opened this issue 8 years ago • 3 comments

I am using oauth2 api. There is a basic token to get to get the bearer token that is sent with every api call. I need to refresh the token from httpInterceptor by injecting auth service in order to refresh the bearer token but I cant inject auth service in to httpinterceptor service. Here is the api documentation

http://opencart3-oauth.api.opencart-api.com/demo/shopping-cart/

please help. It has been one month that i am stucked.

ghost avatar Oct 12 '17 20:10 ghost

Why is it that you can't inject the service? If you are getting a circular dependency error, using the Injector to manually inject your service might help: https://angular.io/api/core/Injector

chenkie avatar Oct 15 '17 00:10 chenkie

yes cyclic because of httpclient in the injected service. A lot of other people face the same issue. Check it out on here https://github.com/angular/angular/issues/18224

Thanks for helping

ghost avatar Oct 15 '17 01:10 ghost

Manually injecting works but just not sure if it is safe to do.

ghost avatar Oct 15 '17 01:10 ghost