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

Use urlsafe_b64decode to properly handle URL-encoded JWTs #352

Merged
merged 1 commit into from
Oct 23, 2023

Conversation

fbeutel
Copy link
Contributor

@fbeutel fbeutel commented Oct 20, 2023

What kind of change does this PR introduce?

Bug fix

What is the current behavior?

When set_session() is called with a base64URL encoded JWT (instead of normal base64 encoding), it fails. Giving it a normally encoded JWT also fails, because the request later uses the access_token as passed here and it requires base64URL encoding.

What is the new behavior?

By using urlsafe_b64decode, base64URL encoded JWTs now work properly

Additional context

none

@codecov
Copy link

codecov bot commented Oct 20, 2023

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (708859c) 45.68% compared to head (0034af1) 45.68%.
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #352   +/-   ##
=======================================
  Coverage   45.68%   45.68%           
=======================================
  Files          23       23           
  Lines        1902     1902           
=======================================
  Hits          869      869           
  Misses       1033     1033           
Files Coverage Δ
gotrue/__init__.py 100.00% <100.00%> (ø)
gotrue/helpers.py 71.87% <50.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@J0
Copy link
Collaborator

J0 commented Oct 23, 2023

Thanks for the contribution!

@J0 J0 merged commit 7541ade into supabase-community:main Oct 23, 2023
8 checks passed
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

Successfully merging this pull request may close these issues.

None yet

2 participants