Class ResolveOttDestinationUseCase

java.lang.Object
com.irurueta.authserver.authorization.application.ott.ResolveOttDestinationUseCase

@Service @Transactional(readOnly=true) public class ResolveOttDestinationUseCase extends Object
Finds where a one-time code of a user may be delivered: the verified e-mail address or the verified phone of an enabled account. Anything else yields an empty result, without saying why.
  • Field Details

    • findUserAccountUseCase

      private final FindUserAccountUseCase findUserAccountUseCase
      Use case that finds an account.
    • userPhoneRepository

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

    • ResolveOttDestinationUseCase

      public ResolveOttDestinationUseCase()
  • Method Details

    • execute

      public Optional<OttDestination> execute(String username, OttChannel channel)
      Resolves the destination of a user.
      Parameters:
      username - name the user signs in with.
      channel - the channel.
      Returns:
      the destination, or empty when the account is unknown or disabled or has no verified address for the channel.
    • addressOf

      private Optional<String> addressOf(UserAccount account, OttChannel channel)
      Reads the verified address of an account for a channel.
      Parameters:
      account - the account.
      channel - the channel.
      Returns:
      the address, or empty when there is no verified one.