isUserMissingMfaAuth method

bool isUserMissingMfaAuth()

Checks whether the signed-in user needs additional MFA.

Implementation

bool isUserMissingMfaAuth() {
  bool instrumentationOperation() {
    if (!_state.initialized) {
      throw DynamicStateException("call initialize() before using the client");
    }
    if (_state.token == null) {
      throw DynamicStateException("not authenticated — sign in first");
    }
    return ((_state.user?.scope ?? "").split(' ').where((word) => word.isNotEmpty).toList()).contains("requiresAdditionalAuth");
  }
  return _api.instrumentation.run("auth.isUserMissingMfaAuth", instrumentationOperation);
}