Added pwned check
Some checks failed
CI / scan_ruby (push) Has been cancelled
CI / scan_js (push) Has been cancelled
CI / lint (push) Has been cancelled
CI / test (push) Has been cancelled

This commit is contained in:
2024-08-21 03:29:40 +02:00
parent 2d5b6655ea
commit e7ef384773
3 changed files with 14 additions and 0 deletions

View File

@@ -13,6 +13,7 @@ class User < ApplicationRecord
validates :email, presence: true, uniqueness: true, format: { with: URI::MailTo::EMAIL_REGEXP }
validates :password, allow_nil: true, length: { minimum: 12 }
validates :password, not_pwned: { message: "might easily be guessed" }
normalizes :email, with: -> { _1.strip.downcase }