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

supabase / supabase-flutter / 28525677261
86%

Build:
DEFAULT BRANCH: main
Ran 01 Jul 2026 02:41PM UTC
Jobs 8
Files 81
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

01 Jul 2026 02:39PM UTC coverage: 85.811% (+0.02%) from 85.79%
28525677261

push

github

web-flow
fix(gotrue): handle access token without amr claim in getAuthenticatorAssuranceLevel (#1478)

## What

`GoTrueClient.mfa.getAuthenticatorAssuranceLevel()` no longer throws
when the current session's access token has no `amr` claim — it returns
an empty `currentAuthenticationMethods` list instead.

## Why

The method cast the claim unconditionally:

```dart
final amr = (payload['amr'] as List)
    .map((e) => AMREntry.fromJson(Map.from(e)))
    .toList();
```

When the access token carries no `amr` claim, `payload['amr']` is
`null`, so `null as List` throws `type 'Null' is not a subtype of type
'List<dynamic>'`. This is a synchronous getter that callers don't expect
to throw, and tokens without `amr` are easy to hit (custom/minimal JWTs,
third-party signers). The fix defaults to an empty list:

```dart
final amr = (payload['amr'] as List? ?? [])
```

## Not a breaking change

When `amr` is present the behavior is identical. The only change is that
an absent claim yields an empty list rather than a crash.

## Tests

Added `packages/gotrue/test/mfa_aal_test.dart`: recovers a session whose
access token has `aal` but no `amr`, and asserts
`getAuthenticatorAssuranceLevel()` returns `aal1` with empty methods.
Without the fix the test crashes with the `Null is not a subtype of
List` cast error.

---------

Co-authored-by: Lukas Klingsbo <lukas.klingsbo@gmail.com>

1 of 1 new or added line in 1 file covered. (100.0%)

4191 of 4884 relevant lines covered (85.81%)

3.86 hits per line

Jobs
ID Job ID Ran Files Coverage
6 supabase - 28525677261.6 01 Jul 2026 02:41PM UTC 15
81.8
GitHub Action Run
7 gotrue - 28525677261.7 01 Jul 2026 02:43PM UTC 27
84.74
GitHub Action Run
8 supabase_flutter - 28525677261.8 01 Jul 2026 02:41PM UTC 11
79.26
GitHub Action Run
3 yet_another_json_isolate - 28433368938.3 30 Jun 2026 09:12AM UTC 1
79.03
GitHub Action Run
7 functions_client - 28444889808.7 30 Jun 2026 12:39PM UTC 2
98.57
GitHub Action Run
6 storage_client - 28444889808.6 30 Jun 2026 12:41PM UTC 5
92.98
GitHub Action Run
7 realtime_client - 28433368938.7 30 Jun 2026 09:15AM UTC 11
88.4
GitHub Action Run
4 postgrest - 28433368938.4 30 Jun 2026 09:14AM UTC 9
84.29
GitHub Action Run
Source Files on build 28525677261
  • Tree
  • List 81
  • Changed 2
  • Source Changed 1
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #28525677261
  • 63a91f2e on github
  • Prev Build on main (#28525039155)
  • Next Build on main (#28533236058)
  • 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