mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-05-02 19:30:48 +08:00
fix: remote register validate
This commit is contained in:
16
app/forms/register/remote_form.rb
Normal file
16
app/forms/register/remote_form.rb
Normal file
@@ -0,0 +1,16 @@
|
||||
module Register
|
||||
class RemoteForm < Register::BaseForm
|
||||
# login 登陆方式,支持邮箱、登陆、手机号等
|
||||
attr_accessor :username, :email, :password, :platform
|
||||
|
||||
validates :username, :email, :password, presence: true
|
||||
validate :check!
|
||||
|
||||
def check!
|
||||
Rails.logger.info "Register::RemoteForm params: username: #{username}; email: #{email}; password: #{password}; platform: #{platform}"
|
||||
check_login(username)
|
||||
check_mail(email)
|
||||
check_password(password)
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user