Class EmailLinkIssuer

java.lang.Object
org.jwcarman.who.emaillink.EmailLinkIssuer

public class EmailLinkIssuer extends Object
Does the real work behind POST /who/email/send, off the request thread: looks up the address, stores the token's hash (the upsert that is also the resend limit), and sends the link.

Nothing here is visible to the /who/email/send caller, who has already been answered 202; that path ignores the EmailLinkOutcome. issue(String, String) never throws: every failure is logged at WARN with only the credential id (when known) and the exception class, never the exception message, the address or the token value.

Each call to issue(String, String) publishes one SignInEmailRequested with its outcome.

  • Field Details

  • Constructor Details

  • Method Details

    • issue

      public EmailLinkOutcome issue(String address, String tokenValue)
      Issues and sends a link if the address belongs to an active identity and no recent link is outstanding, and reports what happened. Never throws: a failure is logged and reported as EmailLinkOutcome.SEND_FAILED. Publishes one SignInEmailRequested with the outcome.

      This method is synchronous. Call it with no transaction open, after your own transaction commits; it does its own writes and sends the email with none open.

      Parameters:
      address - the requested address, as typed; the link goes to the registered (normalized) address
      tokenValue - the generated token value
      Returns:
      what became of the request