mirror of
https://github.com/docusealco/docuseal
synced 2026-11-06 06:52:33 -05:00
improve user email validation
This commit is contained in:
1 parent
8b9678a434
commit
fa0733f480
4 files changed
+37
No files matched your search
@@ -73,6 +73,8 @@ class User < ApplicationRecord
|
||||
scope :archived, -> { where.not(archived_at: nil) }
|
||||
scope :admins, -> { where(role: ADMIN_ROLE) }
|
||||
|
||||
validates :email, format: { with: /\A[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}\z/ }
|
||||
|
||||
def access_token
|
||||
super || build_access_token.tap(&:save!)
|
||||
end
|
||||
|
||||
Reference in new issue
Block a user