• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

supabase / supabase-py / 41635530197
98%

Build:
DEFAULT BRANCH: main
Ran 03 Nov 2026 12:25PM UTC
Jobs 30
Files 175
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

03 Nov 2026 12:25PM UTC coverage: 96.852% (+0.7%) from 96.132%
41635530197

push

github

web-flow
fix(auth): read implicit grant params from the url fragment (#1923)

Fixes SDK-2670. Reopens the fix for SDK-1954 / #1664.

## Problem

`initialize(url=...)` and `initialize_from_url()` only read
`urlparse(url).query`. The implicit grant redirect from Supabase Auth
puts its parameters in the fragment
(`#access_token=...&refresh_token=...`, or
`#error=...&error_description=...` on failure). If you passed in the
real callback URL, nothing happened: you got no session, no `SIGNED_IN`
event and no error.

## Fix

A new private `_parse_url_params()` helper in `helpers.py` merges the
fragment and query parameters, and the query wins on conflicts. This
matches `parseParametersFromURL` in auth-js. `_is_implicit_grant_flow()`
and `_get_session_from_url()` both use it now. A PKCE callback
(`?code=...`) has no `access_token` or `error_description`, so it is
still not treated as an implicit grant.

## Relation to #1665

#1665 made the same change and was closed without being merged. It had
no review, no comments and no stated reason. Because of that, #1664 and
SDK-1954 were marked done while the bug is still on `main`. This PR
applies the same approach and adds wider test coverage.

## Tests

New tests in `tests/_async/test_initialize_from_url.py` (and the
generated sync version) mock HTTP with `httpx.MockTransport`, so they
need no infra:

- Tokens in the fragment produce a session and `SIGNED_IN`.
- `type=recovery` in the fragment also fires `PASSWORD_RECOVERY`.
- A fragment error redirect raises `AuthImplicitGrantRedirectError` with
its details.
- Query parameters win over fragment parameters.
- Query-only URLs keep working.
- A PKCE `?code=` callback is not treated as an implicit grant.

The four fragment tests fail on `main` and pass with this change. mypy
is clean.

13291 of 13723 relevant lines covered (96.85%)

5.01 hits per line

Coverage Regressions

Lines Coverage ∆ File
11
91.63
7.19% src/supabase_auth/_sync/gotrue_client.py
11
91.31
7.19% src/supabase_auth/_async/gotrue_client.py
6
95.21
0.1% src/supabase_auth/helpers.py
Jobs
ID Job ID Ran Files Coverage
1 run-ubuntu-latest-3.14-supabase - 41635530197.1 03 Nov 2026 12:25PM UTC 22
96.92
GitHub Action Run
2 run-ubuntu-latest-3.11-functions - 41635530197.2 03 Nov 2026 12:25PM UTC 18
97.98
GitHub Action Run
3 run-ubuntu-latest-3.14-functions - 41635530197.3 03 Nov 2026 12:25PM UTC 18
97.98
GitHub Action Run
4 run-ubuntu-latest-3.14-auth - 41635530197.4 03 Nov 2026 12:26PM UTC 61
96.36
GitHub Action Run
5 run-ubuntu-latest-3.15-supabase - 41635530197.5 03 Nov 2026 12:25PM UTC 22
96.92
GitHub Action Run
6 run-ubuntu-latest-3.11-supabase - 41635530197.6 03 Nov 2026 12:25PM UTC 22
96.93
GitHub Action Run
7 run-ubuntu-latest-3.12-functions - 41635530197.7 03 Nov 2026 12:25PM UTC 18
97.98
GitHub Action Run
8 run-ubuntu-latest-3.13-functions - 41635530197.8 03 Nov 2026 12:25PM UTC 18
97.98
GitHub Action Run
9 run-ubuntu-latest-3.13-auth - 41635530197.9 03 Nov 2026 12:26PM UTC 61
96.37
GitHub Action Run
10 run-ubuntu-latest-3.15-functions - 41635530197.10 03 Nov 2026 12:25PM UTC 18
97.98
GitHub Action Run
11 run-ubuntu-latest-3.12-auth - 41635530197.11 03 Nov 2026 12:26PM UTC 61
96.37
GitHub Action Run
12 run-ubuntu-latest-3.11-postgrest - 41635530197.12 03 Nov 2026 12:26PM UTC 39
97.7
GitHub Action Run
13 run-ubuntu-latest-3.12-storage - 41635530197.13 03 Nov 2026 12:26PM UTC 42
96.09
GitHub Action Run
14 run-ubuntu-latest-3.14-storage - 41635530197.14 03 Nov 2026 12:26PM UTC 42
96.08
GitHub Action Run
15 run-ubuntu-latest-3.14-postgrest - 41635530197.15 03 Nov 2026 12:26PM UTC 39
97.7
GitHub Action Run
16 run-ubuntu-latest-3.13-storage - 41635530197.16 03 Nov 2026 12:26PM UTC 42
96.09
GitHub Action Run
17 run-ubuntu-latest-3.13-supabase - 41635530197.17 03 Nov 2026 12:25PM UTC 22
96.93
GitHub Action Run
18 run-ubuntu-latest-3.12-supabase - 41635530197.18 03 Nov 2026 12:25PM UTC 22
96.93
GitHub Action Run
19 run-ubuntu-latest-3.11-realtime - 41635530197.19 03 Nov 2026 12:26PM UTC 17
93.21
GitHub Action Run
20 run-ubuntu-latest-3.13-postgrest - 41635530197.20 03 Nov 2026 12:26PM UTC 39
97.7
GitHub Action Run
21 run-ubuntu-latest-3.12-realtime - 41635530197.21 03 Nov 2026 12:26PM UTC 17
93.12
GitHub Action Run
22 run-ubuntu-latest-3.15-auth - 41635530197.22 03 Nov 2026 12:26PM UTC 61
96.36
GitHub Action Run
23 run-ubuntu-latest-3.13-realtime - 41635530197.23 03 Nov 2026 12:26PM UTC 17
93.12
GitHub Action Run
24 run-ubuntu-latest-3.11-auth - 41635530197.24 03 Nov 2026 12:26PM UTC 61
96.37
GitHub Action Run
25 run-ubuntu-latest-3.12-postgrest - 41635530197.25 03 Nov 2026 12:26PM UTC 39
97.7
GitHub Action Run
26 run-ubuntu-latest-3.15-realtime - 41635530197.26 03 Nov 2026 12:27PM UTC 17
92.67
GitHub Action Run
27 run-ubuntu-latest-3.15-postgrest - 41635530197.27 03 Nov 2026 12:26PM UTC 39
97.7
GitHub Action Run
28 run-ubuntu-latest-3.15-storage - 41635530197.28 03 Nov 2026 12:28PM UTC 42
96.08
GitHub Action Run
29 run-ubuntu-latest-3.14-realtime - 41635530197.29 03 Nov 2026 12:26PM UTC 17
92.67
GitHub Action Run
30 run-ubuntu-latest-3.11-storage - 41635530197.30 03 Nov 2026 12:26PM UTC 42
96.09
GitHub Action Run
Source Files on build 41635530197
  • Tree
  • List 175
  • Changed 4
  • Source Changed 0
  • Coverage Changed 4
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #41635530197
  • de2c6fc5 on github
  • Prev Build on main (#41635363760)
  • Next Build on main (#41640930194)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc