Class ResolveOttDestinationUseCase
java.lang.Object
com.irurueta.authserver.authorization.application.ott.ResolveOttDestinationUseCase
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 Summary
FieldsModifier and TypeFieldDescriptionprivate final FindUserAccountUseCaseUse case that finds an account.private final UserPhoneRepositoryPort that reads the verified phones. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddressOf(UserAccount account, OttChannel channel) Reads the verified address of an account for a channel.execute(String username, OttChannel channel) Resolves the destination of a user.
-
Field Details
-
findUserAccountUseCase
Use case that finds an account. -
userPhoneRepository
Port that reads the verified phones.
-
-
Constructor Details
-
ResolveOttDestinationUseCase
public ResolveOttDestinationUseCase()
-
-
Method Details
-
execute
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
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.
-