Skip to content

RequiredClaims missing properties #1089

@dcroote

Description

@dcroote

Bug report

  • I confirm this is a bug with Supabase, not with my own application.
  • I confirm I have searched the Docs, GitHub Discussions, and Discord.

Describe the bug

The docs list claims that are "always present in Supabase JWTs". While some like iss and sub are present in the RequiredClaims object, email, phone, and is_anonymous are not (see below). This interferes with type checking e.g. of claims.email within the object returned by supabase.auth.getClaims().

auth-js/src/lib/types.ts

Lines 1273 to 1286 in 420930e

export type RequiredClaims = {
iss: string
sub: string
aud: string | string[]
exp: number
iat: number
role: string
aal: AuthenticatorAssuranceLevels
session_id: string
}
export type JwtPayload = RequiredClaims & {
[key: string]: any
}

To Reproduce

See above.

Expected behavior

All required claims listed in the docs are present.

Screenshots

N/A

System information

N/A

Additional context

N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions