PortalAuth method. Returns once Portal has accepted the email for delivery. The sign-in itself completes later, when the user taps the link and your app forwards the redirect URL to handleRedirect.
Parameters
email: The user’s email address. Trimmed and lowercased before sending, because the backend requires a lowercase address and does not trim.
PortalAuthError.magicLinkNotConfigured: The instance was created withoutmagicLink. Raised before any network call.PortalAuthError.invalidArgument(name: "email"): The address is empty or blank. Raised before any network call.PortalAuthError.rateLimited: Portal returned429; too many links were sent to this address in the last minute. The SDK never retries on your behalf.PortalAuthError.accountAbstractionUnavailable(message:):isAccountAbstracted: truewas requested but gas sponsorship is not enabled for your organization or not configured for the environment.PortalRequestsError.unauthorized: TheredirectUrlis not on the environment’s allow list, thefromEmaildoes not belong to a sending domain enabled for the environment, thetemplateIddoes not exist, or the Auth Environment ID does not match an environment with authentication switched on.- Other transport errors unchanged.
- Every call sends a real email, and sends are rate limited to 10 per address per minute. Never retry automatically; a resend should be an explicit user action, and a short cooldown on the button avoids the rate limit.
- The link carries a single-use token that expires after 15 minutes. Some email security scanners prefetch links, which can spend the token before the user taps it; handle
PortalRequestsError.unauthorizedfromhandleRedirectby offering a new link. - Requires a verified sending domain and an email template; see Email magic links.
- Unlike the other Portal SDKs, the address is lowercased for you, so you do not need to normalize it first.
- Never log the email address.
- Available starting from SDK version 8.0.0.