createSession method

Future<Response> createSession({
  1. required String email,
  2. required String password,
})

Create Account Session

Allow the user to login into their account by providing a valid email and password combination. This route will create a new session for the user.

Implementation

Future<req.Response> createSession(
    {required String email, required String password}) {
  final String path = '/account/sessions';

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

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

  return client.call(HttpMethod.post,
      path: path, params: params, headers: headers);
}