areSecurityChallengesNeeded function

Future<bool> areSecurityChallengesNeeded(
  1. AccessToken accessToken
)

Checks whether or not the user has to answer the security challenges. This will return true if the current location is not verified and needs to be verified using getSecurityChallenges and answerSecurityChallenges.

Implementation

Future<bool> areSecurityChallengesNeeded(AccessToken accessToken) async {
  final headers = {
    'authorization': 'Bearer $accessToken',
  };
  final response = await request(http.get, _mojangApi, 'user/security/location',
      headers: headers);
  return response.statusCode == 403;
}