authorize method

  1. @override
Future<Widget?> authorize(
  1. BuildContext context,
  2. AuthorizationState authState
)
override

Implementation

@override
Future<Widget?> authorize(
    BuildContext context, AuthorizationState authState) async {
  final exists = await _hasCredentials();
  if (exists) {
    try {
      await _tryAuthorize();
      authState.recycle();
      return Container();
    } catch (e) {
      log('Failed using saved credentials', error: e);
    }
  }
  return _FormIdentitySignInWidget(
    onDone: () => authState.recycle(),
  );
}