


# reauthenticate method




    *[<Null safety>](https://dart.dev/null-safety)*



- @[override](https://api.flutter.dev/flutter/dart-core/override-constant.html)

[Future](https://api.flutter.dev/flutter/dart-async/Future-class.html)&lt;[Account](../../wyatt_authentication_bloc/Account-class.md)> reauthenticate
()

_<span class="feature">override</span>_



<p>Some security-sensitive actions—such as deleting an account,
setting a primary email address, and changing a password—require that
the user has recently signed in.</p>
<p>Throws a ReauthenticateFailureInterface if
an exception occurs.</p>



## Implementation

```dart
@override
Future<Account> reauthenticate() async {
  final latestCreds =
      await _latestCredentials.stream.asBroadcastStream().last;
  try {
    if (latestCreds?.credential != null) {
      await _firebaseAuth.currentUser
          ?.reauthenticateWithCredential(latestCreds!.credential!);
    } else {
      throw Exception(); // Get caught just after.
    }

    final account = AccountModel.fromFirebaseUser(_firebaseAuth.currentUser);

    return account;
  } on FirebaseAuthException catch (e) {
    throw ReauthenticateFailureFirebase.fromCode(e.code);
  } catch (_) {
    throw ReauthenticateFailureFirebase();
  }
}
```







