obtainTokenAndLogin method

  1. @override
Future<void> obtainTokenAndLogin({
  1. required TokenObtainRequest tokenObtainRequest,
})
override

Authenticates the user based on provided credentials (e.g., username+password or email+OTP etc) and logs them in by obtaining and processing a JWT token.

Implementation

@override
Future<void> obtainTokenAndLogin({
  required TokenObtainRequest tokenObtainRequest,
}) async =>
    _authApiChecker(() async {
      final tokenResult = (await authApi?.authTokenCreate(
        tokenObtainRequest: tokenObtainRequest,
      ))
          ?.data;
      final token = tokenResult?.token;

      await _loginUsingToken(token);
    });