finishRegistration method
Completes a new account registration, creating a new auth user with a profile and attaching the given email account to it.
Throws an EmailAccountRequestException in case of errors, with reason:
- EmailAccountRequestExceptionReason.expired if the account request has already expired.
- EmailAccountRequestExceptionReason.policyViolation if the password does not comply with the password policy.
- EmailAccountRequestExceptionReason.invalid if the
registrationTokenis invalid.
Throws an AuthUserBlockedException if the auth user is blocked.
Returns a session for the newly created user.
Implementation
Future<AuthSuccess> finishRegistration(
final Session session, {
required final String registrationToken,
required final String password,
}) async {
return emailIdp.finishRegistration(
session,
registrationToken: registrationToken,
password: password,
);
}