completeAuthentication method

Future<void> completeAuthentication({
  1. String? credential,
})

Compatibility helper for callers that do not yet use session IDs.

Implementation

Future<void> completeAuthentication({String? credential}) async {
  await _waitForExpiry();
  if (credential != null) {
    await _strategy.saveCredentials(credential, _context);
  }
  await _context.secureStorage.delete(key: _expiredReasonKey);
  _set(
    AuthSession(
      status: AuthSessionStatus.authenticated,
      changedAt: DateTime.now().toUtc(),
      sessionId: _current.sessionId,
      reason: 'login_completed',
    ),
  );
}