signIn method

Future<AuthSession> signIn({
  1. required String email,
  2. required String otp,
  3. String? name,
  4. String? image,
})

Signs in with otp and returns the issued session.

Throws FormatException when the response does not contain a session.

Implementation

Future<AuthSession> signIn({
  required String email,
  required String otp,
  String? name,
  String? image,
}) async {
  final response = await transport.request(
    'POST',
    const AuthRoutePath('/sign-in/email-otp'),
    body: {'email': email, 'otp': otp, 'name': ?name, 'image': ?image},
  );
  return _sessionFromBody(response.body);
}