revoke method

Future<AuthResponse<void>> revoke(
  1. String sessionId
)

Revokes a specific session by ID.

sessionId The ID of the session to revoke.

Returns an AuthResponse indicating success or failure.

Example:

await authClient.session.revoke('session_123');

Implementation

Future<AuthResponse<void>> revoke(String sessionId) async {
  try {
    await _dio.post(ApiEndpoints.revokeSession, data: {'sessionId': sessionId});
    return AuthResponse.success(null);
  } on DioException catch (e) {
    return AuthResponse.error(AuthError.fromDio(e));
  }
}