Record Class EmailCodeRequested

java.lang.Object
java.lang.Record
com.irurueta.authserver.authorization.application.ott.EmailCodeRequested
Record Components:
address - the verified e-mail address.
code - the code in clear text.
validFor - how long the code stays valid, shown to the user.

public record EmailCodeRequested(String address, String code, Duration validFor) extends Record
Event published when a one-time code must be e-mailed. It is delivered once the transaction that stored the code commits, outside of it and off the request thread, so the mail server's latency neither holds a database connection nor shows in the response (which would tell an existing account from an unknown one).
  • Field Details

    • address

      private final String address
      The field for the address record component.
    • code

      private final String code
      The field for the code record component.
    • validFor

      private final Duration validFor
      The field for the validFor record component.
  • Constructor Details

  • Method Details

    • toString

      public String toString()
      Describes the event without the address and the code, so neither ever reaches a log.
      Specified by:
      toString in class Record
      Returns:
      the description.
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • address

      public String address()
      Returns the value of the address record component.
      Returns:
      the value of the address record component
    • code

      public String code()
      Returns the value of the code record component.
      Returns:
      the value of the code record component
    • validFor

      public Duration validFor()
      Returns the value of the validFor record component.
      Returns:
      the value of the validFor record component