Function Signature
Description
APortalAuth method, and the single completion path for every sign-in method: magic links and the Google and Apple callbacks. It exchanges the grant on the redirect for a session, which is persisted on the device before the result is returned.
It returns null for any URL that is not a Portal redirect for the configured redirectUrl, so every deep link your app receives can be passed here.
A redirect the OS delivers twice returns the same result instead of failing the backend’s single-use check. Only successful exchanges are remembered, and the memory lives in the native instance and this process: configure and clearPersistedSession reset it, and it does not survive the app being terminated.
Available starting from portal_flutter 2.0.0.
Parameters
Returns
PortalAuthResult?:
null: the URL is not a Portal sign-in for thisredirectUrl. Let your other routes handle it.PortalAuthenticated: the sign-in is complete. PasssessiontoPortal().initialize(session:).PortalTotpRequired: a TOTP code is required. Nothing is persisted yet; complete it withverifyTotp.