fix: Case insensitive email match (#6760)
Fixes: https://linear.app/chatwoot/issue/CW-1354/email-id-case-sensitive Co-authored-by: Sojan <sojan@pepalo.com>
This commit is contained in:
@@ -106,6 +106,10 @@ class User < ApplicationRecord
|
||||
|
||||
scope :order_by_full_name, -> { order('lower(name) ASC') }
|
||||
|
||||
before_validation do
|
||||
self.email = email.try(:downcase)
|
||||
end
|
||||
|
||||
def send_devise_notification(notification, *args)
|
||||
devise_mailer.with(account: Current.account).send(notification, self, *args).deliver_later
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user