confirm method
Confirms a verification challenge.
This method is used to confirm email verification challenges such as magic links or one-time codes. It validates the challenge token received from the verification process.
Parameters
email: The email address being verified (optional)challengeToken: The challenge token from the verification process
Returns
A Future that resolves to a record containing:
existingUser: Whether a user with this email already exists
Throws
HttpExceptionif there's a network errorCalljmpExceptionif the challenge token is invalid
Example
final confirmation = await calljmp.users.auth.email.confirm(
email: 'user@example.com',
challengeToken: 'token-from-email',
);
print('User exists: ${confirmation.existingUser}');
Implementation
Future<({bool existingUser})> confirm({
String? email,
required String challengeToken,
}) => http
.request("${_config.serviceUrl}/users/auth/email/confirm")
.use(http.context(_config))
.use(http.access())
.post({"email": email, "token": challengeToken})
.json((json) => (existingUser: json["existingUser"]));