chenkie / angular-auth

17 stars 10 forks source link

I am using oauth2 api. #2

Open ghost opened 7 years ago

ghost commented 7 years ago

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.

chenkie commented 7 years ago

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

ghost commented 7 years ago

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 commented 7 years ago

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