create method
Create a user with a an email and password
Implementation
Future<BagelUser?> create(email, password) async {
String url = '$authEndpoint/user';
Map body = {"email": email, "password": password};
try {
Response res = await dio.post(url, data: body);
_storeTokens(res.data);
return _setUser(res.data["user_id"], email: email);
} catch (err) {
if (err is DioException) throw (err.response.toString());
}
return null;
}