Class HasVerifiedPhoneUseCase

java.lang.Object
com.irurueta.authserver.authorization.application.sms.HasVerifiedPhoneUseCase
All Implemented Interfaces:
SecondFactorEnrolmentQuery

@Service @Transactional(readOnly=true) public class HasVerifiedPhoneUseCase extends Object implements SecondFactorEnrolmentQuery
Tells whether a user has a verified phone. As the enrolment query of the SMS second factor, a user with a verified phone requires multi-factor authentication.
  • Field Details

    • userPhoneRepository

      private final UserPhoneRepository userPhoneRepository
      Port that reads the verified phones.
  • Constructor Details

    • HasVerifiedPhoneUseCase

      public HasVerifiedPhoneUseCase()
  • Method Details

    • execute

      public boolean execute(UUID userId)
      Tells whether a user has a verified phone.
      Parameters:
      userId - identifier of the user.
      Returns:
      true when a phone of the user is verified.
    • hasConfirmed

      public boolean hasConfirmed(UUID userId)
      Tells whether a user has confirmed the SMS second factor.
      Specified by:
      hasConfirmed in interface SecondFactorEnrolmentQuery
      Parameters:
      userId - identifier of the user.
      Returns:
      the same as execute(UUID).