add password max length 16 to register

dev_sync_trustie
p31729568 5 years ago
parent d968a8fa73
commit 0626ea706e

@ -666,6 +666,10 @@ class User < ApplicationRecord
if password.present? && password.size < MIX_PASSWORD_LIMIT && !User.current.admin?
raise("密码长度不能低于#{MIX_PASSWORD_LIMIT}")
end
if password.present? && password.size > 16
raise('密码长度不能超过16位')
end
end
end

Loading…
Cancel
Save