Module: MinimalistAuthentication::EmailVerification

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

Instance Method Summary collapse

Instance Method Details

#email_verified?Boolean

Returns:

  • (Boolean)


21
22
23
# File 'lib/minimalist_authentication/email_verification.rb', line 21

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

#needs_email_set?Boolean

Returns:

  • (Boolean)


13
14
15
# File 'lib/minimalist_authentication/email_verification.rb', line 13

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

#needs_email_verification?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/minimalist_authentication/email_verification.rb', line 17

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

#verify_email(token) ⇒ Object



25
26
27
# File 'lib/minimalist_authentication/email_verification.rb', line 25

def verify_email(token)
  secure_update(token, email_verified_at: Time.zone.now)
end