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

How to add header to request? #165

Open
vforv opened this issue Oct 19, 2017 · 1 comment
Open

How to add header to request? #165

vforv opened this issue Oct 19, 2017 · 1 comment

Comments

@vforv
Copy link

vforv commented Oct 19, 2017

Is there any way to send also header with requests?

@m1m1s1ku
Copy link

m1m1s1ku commented Apr 12, 2018

The only way i found to achieve this is to set a requestInterceptor in the swagger-ui init (in index.hbs of hapi-swaggered-ui) :
Something like this in the SwaggerUIBundle(Object.assign({....

requestInterceptor: (req) => {
      req.headers.Authorization = 'Bearer ' + localStorage.getItem('token');
      return req;
},

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

2 participants