createVerification method

Future<Token> createVerification({
  1. required String url,
})

Create Email Verification

Use this endpoint to send a verification message to your user email address to confirm they are the valid owners of that address. Both the userId and secret arguments will be passed as query parameters to the URL you have provided to be attached to the verification email. The provided URL should redirect the user back to your app and allow you to complete the verification process by verifying both the userId and secret parameters. Learn more about how to complete the verification process. The verification link sent to the user's email address is valid for 7 days.

Please note that in order to avoid a Redirect Attack, the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface.

Implementation

Future<models.Token> createVerification({required String url}) async {
  const String path = '/account/verification';

  final Map<String, dynamic> params = {
    'url': url,
  };

  final Map<String, String> headers = {
    'content-type': 'application/json',
  };

  final res = await client.call(HttpMethod.post,
      path: path, params: params, headers: headers);

  return models.Token.fromMap(res.data);
}