Closed pi-kei closed 8 months ago
@tangyang9464 @imp2002 please review
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.
:tada: This PR is included in version 0.36.0 :tada:
The release is available on GitHub release
Your semantic-release bot :package::rocket:
@hsluoyz I'm sorry but I've not tested this properly. So, it is not working as expected. Now casdoorsdk.Claims.TokenType
is always equals to access-token
because of how json decoder works.
Here's the quote from docs:
To unmarshal JSON into a struct, Unmarshal matches incoming object keys to the keys used by Marshal (either the struct field name or its tag), preferring an exact match but also accepting a case-insensitive match.
Right now it's treating tokenType
and TokenType
as the same field. To fix that there must be both of them in struct. I can do a fix PR for that.
@pi-kei I told you to test your code locally before submitting it. Now this PR will be reverted. And I have to see your demo video to show the test case running well (but don't submit it) before merging your PR again
Fix: https://github.com/casdoor/casdoor-go-sdk/issues/99#issuecomment-1954464072
Add
TokenType
field tocasdoorsdk.Claims
. AddIsRefreshToken
func tocasdoorsdk.Claims
. This feature will let you find out if you are dealing with refresh token or access token.