clearSession method

Future<void> clearSession(
  1. String userId
)

Clears user session

Implementation

Future<void> clearSession(String userId) async {
  try {
    final file = File('$_sessionDir/$_sessionFile');
    if (await file.exists()) {
      await file.delete();
    }

    print('Cognito session cleared for user: $userId');
  } catch (e) {
    print('Failed to clear session: $e');
    throw DSAuthError('Failed to clear session');
  }
}