authRefresh method
Refreshes the current authenticated auth record instance and returns a new token and record data.
On success this method automatically updates the client's AuthStore.
Implementation
Future<RecordAuth> authRefresh({
String? expand,
String? fields,
Map<String, dynamic> body = const {},
Map<String, dynamic> query = const {},
Map<String, String> headers = const {},
}) {
final enrichedQuery = Map<String, dynamic>.of(query);
enrichedQuery["expand"] ??= expand;
enrichedQuery["fields"] ??= fields;
return client
.send<Map<String, dynamic>>(
"$baseCollectionPath/auth-refresh",
method: "POST",
body: body,
query: enrichedQuery,
headers: headers,
)
.then(_authResponse);
}