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

Fail to get jwt token #14443

Merged
merged 4 commits into from
Mar 30, 2021
Merged

Fail to get jwt token #14443

merged 4 commits into from
Mar 30, 2021

Conversation

hwqllang
Copy link
Contributor

@hwqllang hwqllang commented Mar 24, 2021

Fix #14488

  • authenticationToken need parsed
  • key name is wrong in localStorage

Please make sure the below checklist is followed for Pull Requests.

When you are still working on the PR, consider converting it to Draft (bellow reviewers) and adding skip-ci label, you can still see CI build result at your branch.

@CLAassistant
Copy link

CLAassistant commented Mar 24, 2021

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
2 out of 3 committers have signed the CLA.

✅ mshima
✅ hwqllang
❌ Gitea


Gitea seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@mshima
Copy link
Member

mshima commented Mar 26, 2021

@hwqllang thanks for your PR.
Can you sign the cla?

We need to check if JSON.parse is required for all 3 client frameworks.

@gmarziou
Copy link
Contributor

@hwqllang can you explain why token parsing is required in swagger-ui?

Personally, I don't understand it because next line is using it in header as bearer token so I would think that base64 encoding is expected.

@pascalgrimaud
Copy link
Member

I think there is indeed a bug in your current 7.0.0, but it needs to be confirmed:

  • Angular / React: swagger broken
  • Vue: swagger is fine

This PR seems to fix the issue for Angular and React, but it won't work for Vue.
So IMO, the issue comes from the way how the token is stored

Copy link
Member

@mshima mshima left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pascalgrimaud the problem seems to be that ngx-webstorage stores it encoded.
At this page we use bare localStorage.
Not sure we can fix it another way.

@mshima mshima mentioned this pull request Mar 28, 2021
1 task
@mshima
Copy link
Member

mshima commented Mar 28, 2021

@hwqllang can you fix the user of the first commit?

@hwqllang
Copy link
Contributor Author

@mshima sorry for that, the user of the first commit is wrong, it is default user of my server, and I don't know how to fix it.

@mshima mshima merged commit 7fe52b5 into jhipster:main Mar 30, 2021
@mshima
Copy link
Member

mshima commented Mar 30, 2021

@hwqllang thanks and congrats for your first contribution.

@mshima
Copy link
Member

mshima commented Mar 30, 2021

Tested with angular/react and remember me enabled/disabled.

@pascalgrimaud
Copy link
Member

@hwqllang : it's an important bug so I added a bounty on this. Don't forget to claim it

@hwqllang
Copy link
Contributor Author

@pascalgrimaud
Copy link
Member

@hwqllang : approved and thanks for your fix

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

Successfully merging this pull request may close these issues.

Swagger authtentication is broken
5 participants