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

Add JWT header to requests only if a token is set #293

Closed
1 of 2 tasks
Darkheir opened this issue Mar 11, 2018 · 1 comment
Closed
1 of 2 tasks

Add JWT header to requests only if a token is set #293

Darkheir opened this issue Mar 11, 2018 · 1 comment

Comments

@Darkheir
Copy link
Contributor

Issue type

I'm submitting a ... (check one with "x")

  • bug report
  • feature request

Issue description

Current behavior:
When the JWT token doesn't exist the Authorization is still added by the interceptor as follow: Authorization:Bearer null

Expected behavior:
The Header shouldnot be added if no JWT token is present

Steps to reproduce:
Setup the NbAuthJWTInterceptor and send an http request

Related code:
In NbAuthJWTInterceptor the following code

if (token) {
    const JWT = `Bearer ${token.getValue()}`;
    ...

should be changed to

if (token.isValid()) {
    const JWT = `Bearer ${token.getValue()}`;
    ...
@nnixaa
Copy link
Collaborator

nnixaa commented Mar 13, 2018

@Darkheir merged! Thanks for your contribution.

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

No branches or pull requests

2 participants