signInWithMicrosoft method

Future<UserCredential> signInWithMicrosoft()

Signs in the user using Microsoft authentication and returns the user credential.

Implementation

Future<UserCredential> signInWithMicrosoft() async {
  try {
    final microsoftProvider = MicrosoftAuthProvider();
    if (isWeb) {
      return await _auth.signInWithPopup(microsoftProvider);
    } else {
      return await _auth.signInWithProvider(microsoftProvider);
    }
  } catch (err) {
    if (err is FirebaseAuthException) {
      throw AuthDataServiceException.fromRdevException(err.toRdevException());
    }
    throw AuthDataServiceException(
      message: err.toString(),
    );
  }
}