getSession method

  1. @override
Future<SIWESession> getSession()
override

Implementation

@override
Future<SIWESession> getSession() async {
  if (!enabled) throw Exception('siweConfig not enabled');
  //
  try {
    _appKit.core.logger.d('[$runtimeType] getSession() called');
    final siweSession = await _siweConfig!.getSession();
    if (siweSession == null) {
      throw ReownAppKitModalException('Error getting SIWE session');
    }
    _siweConfig.onSignIn?.call(siweSession);

    return siweSession;
  } catch (e) {
    rethrow;
  }
}