Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I am using oauth2 api. #2

Open
ghost opened this issue Oct 12, 2017 · 3 comments
Open

I am using oauth2 api. #2

ghost opened this issue Oct 12, 2017 · 3 comments

Comments

@ghost
Copy link

ghost commented Oct 12, 2017

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
Copy link
Owner

chenkie commented Oct 15, 2017

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
Copy link
Author

ghost commented Oct 15, 2017

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

Thanks for helping

@ghost
Copy link
Author

ghost commented Oct 15, 2017

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant