refreshToken method
Implementation
Future<Session> refreshToken({
required String sessionId,
required String refreshToken,
}) async {
final body = <String, dynamic>{
'refreshToken': refreshToken,
};
final response = await _post(
path: '/sessions/$sessionId/refresh',
body: body,
);
final json = jsonDecode(response.body);
if (response.statusCode >= 400) {
return Future.error(ApiError.fromJson(json));
}
return Session.fromJson(json);
}