refresh method

Future<AdminAuth> refresh({
  1. Map<String, dynamic> body = const {},
  2. Map<String, dynamic> query = const {},
  3. Map<String, String> headers = const {},
})

Refreshes the current admin authenticated instance and returns a new auth token and admin data.

On success this method automatically updates the client"s AuthStore.

Implementation

Future<AdminAuth> refresh({
  Map<String, dynamic> body = const {},
  Map<String, dynamic> query = const {},
  Map<String, String> headers = const {},
}) {
  return client
      .send(
        "$baseCrudPath/auth-refresh",
        method: "POST",
        body: body,
        query: query,
        headers: headers,
      )
      .then((data) => _authResponse(data as Map<String, dynamic>? ?? {}));
}