Method: SmtpConfiguration#validate_token

Defined in:
lib/app/models/smtp_configuration.rb

#validate_token(token) ⇒ Object

Validate the token, returning true of false if valid



50
51
52
53
54
55
56
57
58
59
# File 'lib/app/models/smtp_configuration.rb', line 50

def validate_token(token)
  valid = if confirmation_token.present? && confirmation_token.eql?(token)
            unset(:confirmation_token, :verification_message)
            true
          else
            false
          end
  set(confirmed: valid)
  valid
end