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

supabase / supabase-flutter / 27970191844
85%

Build:
DEFAULT BRANCH: main
Ran 22 Jun 2026 05:09PM UTC
Jobs 8
Files 80
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

22 Jun 2026 05:06PM UTC coverage: 85.26% (+0.01%) from 85.246%
27970191844

push

github

web-flow
fix(supabase_flutter): clear auth params from web URL after exchange (#1456)

## What

On Flutter web, after a successful OAuth/PKCE sign-in the auth `code`
(or implicit-flow tokens) stays in the browser URL. On the next page
refresh, `supabase_flutter` reads that URL again, sees the stale `code`,
and tries to exchange it a second time. The code verifier was already
consumed and removed during the first exchange, so the second attempt
throws:

```
AuthException(message: Code verifier could not be found in local storage.)
```

This logs the user out on every refresh while the `code` is still in the
URL.

## Fix

After a successful `getSessionFromUrl` on web, strip the auth parameters
from the browser URL using `history.replaceState`, mirroring what
`supabase-js` does. Unrelated query and fragment parameters are
preserved.

- `clear_auth_url_parameters.dart` holds the pure, testable
URL-stripping logic.
- `clear_auth_url_parameters_web.dart` / `_stub.dart` follow the
existing conditional-import pattern (`if (dart.library.js_interop)`) so
non-web platforms get a no-op.
- The cleanup is invoked from `_handleDeeplink` only on web after the
exchange succeeds.

## Test

Added `clear_auth_url_parameters_test.dart` covering PKCE code, implicit
fragment tokens, error params, and preservation of unrelated params.

Closes #836

16 of 18 new or added lines in 3 files covered. (88.89%)

1 existing line in 1 file now uncovered.

4101 of 4810 relevant lines covered (85.26%)

3.57 hits per line

Uncovered Changes

Lines Coverage ∆ File
1
0.0
packages/supabase_flutter/lib/src/clear_auth_url_parameters_stub.dart
1
63.11
-0.62% packages/supabase_flutter/lib/src/supabase_auth.dart

Coverage Regressions

Lines Coverage ∆ File
1
63.11
-0.62% packages/supabase_flutter/lib/src/supabase_auth.dart
Jobs
ID Job ID Ran Files Coverage
8 supabase_flutter - 27970191844.8 22 Jun 2026 05:09PM UTC 11
77.78
GitHub Action Run
2 functions_client - 27952543454.2 22 Jun 2026 12:27PM UTC 2
97.14
GitHub Action Run
3 yet_another_json_isolate - 27952543454.3 22 Jun 2026 12:27PM UTC 1
79.03
GitHub Action Run
4 storage_client - 27952543454.4 22 Jun 2026 12:29PM UTC 5
93.0
GitHub Action Run
7 realtime_client - 27952543454.7 22 Jun 2026 12:30PM UTC 11
88.15
GitHub Action Run
6 gotrue - 27963702382.6 22 Jun 2026 03:26PM UTC 26
83.52
GitHub Action Run
8 supabase - 27963702382.8 22 Jun 2026 03:24PM UTC 15
82.38
GitHub Action Run
1 postgrest - 27952543454.1 22 Jun 2026 12:30PM UTC 9
84.16
GitHub Action Run
Source Files on build 27970191844
  • Tree
  • List 80
  • Changed 2
  • Source Changed 2
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #27970191844
  • 8b1e1b22 on github
  • Prev Build on main (#27963702382)
  • Next Build on main (#27970805559)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc