Skip to content

Assert asyncStorage is provided for PKCE flow in the GoTrue client constructor #1446

Description

@spydon

Follow-up from #1349 (originally fixing #1319).

When flowType is AuthFlowType.pkce (the default) and no asyncStorage is provided, calling getOAuthSignInUrl() or getLinkIdentityUrl() fails late at call time. PR #1349 mitigated this by throwing a descriptive AuthException instead of crashing with a cryptic null check error in release mode.

A better long-term solution is to validate this requirement up front by adding an assert in the constructor of the GoTrue client, so the misconfiguration surfaces immediately rather than only when an affected method is called.

This is a breaking change and is therefore planned for v3.

Originally proposed in #1349 (comment) by @Vinzent03.

Metadata

Metadata

Assignees

No one assigned

    Labels

    authThis issue or pull request is related to authenticationenhancementNew feature or requestplannedThis issue is planned and should not be automatically closed due to being stale.v3

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions