Browse Source

fixed 第三方授权登录(github,gitee,qq,wechat)

pull/313/head
xxq250 3 years ago
parent
commit
6b846b10bb
1 changed files with 6 additions and 2 deletions
  1. +6
    -2
      app/controllers/concerns/register_helper.rb

+ 6
- 2
app/controllers/concerns/register_helper.rb View File

@@ -1,7 +1,7 @@
module RegisterHelper
extend ActiveSupport::Concern

def autologin_register(username, email, password, platform = 'forge', phone = nil, nickname =nil)
def autologin_register(username, email, password, platform = 'forge', phone = nil, nickname =nil, need_edit_info = false)
result = {message: nil, user: nil}
email = email.blank? ? "#{username}@example.org" : email

@@ -10,7 +10,11 @@ module RegisterHelper
user.platform = platform
user.phone = phone if phone.present?
user.nickname = nickname if nickname.present?
user.activate
if need_edit_info
user.need_edit_info
else
user.activate
end

return unless user.valid?



Loading…
Cancel
Save