createEmailPasswordSession method
Create email password 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.
A user is limited to 10 active sessions at a time by default. Learn more about session limits.
Implementation
Future<models.Session> createEmailPasswordSession(
{required String email, required String password}) async {
const String apiPath = '/account/sessions/email';
final Map<String, dynamic> apiParams = {
'email': email,
'password': password,
};
final Map<String, String> apiHeaders = {
'content-type': 'application/json',
};
final res = await client.call(HttpMethod.post,
path: apiPath, params: apiParams, headers: apiHeaders);
return models.Session.fromMap(res.data);
}