Module: MinimalistAuthentication::EmailVerification

Extended by:
ActiveSupport::Concern
Defined in:
lib/minimalist_authentication/email_verification.rb

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

Instance Method Details

#email_verified?Boolean

Returns:

  • (Boolean)


31
32
33
# File 'lib/minimalist_authentication/email_verification.rb', line 31

def email_verified?
  email.present? && email_verified_at.present?
end

#needs_email_set?Boolean

Returns:

  • (Boolean)


35
36
37
# File 'lib/minimalist_authentication/email_verification.rb', line 35

def needs_email_set?
  request_email_enabled? && email.blank?
end

#needs_email_verification?Boolean

Returns:

  • (Boolean)


39
40
41
# File 'lib/minimalist_authentication/email_verification.rb', line 39

def needs_email_verification?
  email_verification_enabled? && email.present? && email_verified_at.blank?
end

#verify_email(token) ⇒ Object



43
44
45
# File 'lib/minimalist_authentication/email_verification.rb', line 43

def verify_email(token)
  touch(:email_verified_at) if token_owner?(:email_verification, token)
end