Class RequestMagicLinkUseCase

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

@Service @Transactional(readOnly=true) public class RequestMagicLinkUseCase extends Object
Sends a magic link to the verified e-mail address of an enabled account. It is enumeration-safe: for an unknown identifier, a disabled account or an address that is not verified nothing is sent and nothing is reported. The link is not delivered here but through an EmailLinkRequested event, handled after the transaction commits and off the request thread, so that no remote call runs inside a transaction and the mail server's latency does not show.
  • Field Details

    • resolveOttDestinationUseCase

      private final ResolveOttDestinationUseCase resolveOttDestinationUseCase
      Use case that finds the e-mail address of the account.
    • ottPolicy

      private final OttPolicy ottPolicy
      Policy of the tokens, which sets the lifetime shown with the link.
    • eventPublisher

      private final org.springframework.context.ApplicationEventPublisher eventPublisher
      Publishes the delivery request.
  • Constructor Details

    • RequestMagicLinkUseCase

      public RequestMagicLinkUseCase()
  • Method Details

    • execute

      public void execute(String identifier, URI link)
      Requests the delivery of a link.
      Parameters:
      identifier - the name the user signs in with.
      link - the link that opens the confirmation page.