Class AnonEmailVerificationService

java.lang.Object
dev.getelements.elements.service.user.AnonEmailVerificationService
All Implemented Interfaces:
dev.getelements.elements.sdk.service.user.EmailVerificationService

public class AnonEmailVerificationService extends Object
Anonymous implementation of EmailVerificationService.

Allows completeVerification(java.lang.String) so that the public GET /verify endpoint works without authentication. requestVerification(java.lang.String, java.lang.String) always throws ForbiddenException.

  • Constructor Details

    • AnonEmailVerificationService

      public AnonEmailVerificationService()
  • Method Details

    • requestVerification

      public dev.getelements.elements.sdk.model.user.UserUid requestVerification(String email, String verificationBaseUrl)
    • completeVerification

      public dev.getelements.elements.sdk.model.user.UserUid completeVerification(String token)
    • getUserUidDao

      public dev.getelements.elements.sdk.dao.UserUidDao getUserUidDao()
    • setUserUidDao

      @Inject public void setUserUidDao(dev.getelements.elements.sdk.dao.UserUidDao userUidDao)
    • getTokenDao

      public dev.getelements.elements.sdk.dao.UidVerificationTokenDao getTokenDao()
    • setTokenDao

      @Inject public void setTokenDao(dev.getelements.elements.sdk.dao.UidVerificationTokenDao tokenDao)
    • getEmailService

      public dev.getelements.elements.sdk.service.email.EmailService getEmailService()
    • setEmailService

      @Inject public void setEmailService(dev.getelements.elements.sdk.service.email.EmailService emailService)
    • getElementRegistry

      public dev.getelements.elements.sdk.ElementRegistry getElementRegistry()
    • setElementRegistry

      @Inject public void setElementRegistry(dev.getelements.elements.sdk.ElementRegistry elementRegistry)
    • getEmailSubject

      protected String getEmailSubject()
      Returns the subject line for the verification email.

      Override this in a subclass to supply a custom subject without reimplementing the full verification flow. The default returns the value injected via EmailVerificationService.VERIFICATION_EMAIL_SUBJECT.

    • setEmailSubject

      @Inject public void setEmailSubject(@Named("dev.getelements.elements.verification.email_subject") String emailSubject)
    • getEmailTemplate

      protected String getEmailTemplate()
      Returns the HTML body template for the verification email.

      Override this in a subclass to supply a custom template without reimplementing the full verification flow. The template must contain the literal token {link}, which is replaced at send-time with the full verification URL. The default returns the value injected via EmailVerificationService.VERIFICATION_EMAIL_TEMPLATE.

      To back this with a database (for a live UI editor), inject a DAO here and read from it, falling back to super.getEmailTemplate() when no override is stored.

    • setEmailTemplate

      @Inject public void setEmailTemplate(@Named("dev.getelements.elements.verification.email_template") String emailTemplate)