mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-05-03 03:40:49 +08:00
fixed 随机密码防止溢出
This commit is contained in:
@@ -39,7 +39,9 @@ class Oauth::CallbacksController < Oauth::BaseController
|
||||
new_user = true
|
||||
login = build_login_name(platform, auth_hash.info.nickname)
|
||||
mail = "#{login}@example.org" if mail.blank?
|
||||
reg_result = autologin_register(login, mail, "Ec#{login}2022#", platform, nil, nickname)
|
||||
code = %W(0 1 2 3 4 5 6 7 8 9)
|
||||
rand_password = code.sample(10).join
|
||||
reg_result = autologin_register(login, mail, rand_password, platform, nil, nickname)
|
||||
Rails.logger.info("[OAuth2] omniauth.auth [reg_result] #{reg_result} ")
|
||||
if reg_result[:message].blank?
|
||||
open_user = "OpenUsers::#{platform.to_s.capitalize}".constantize.create!(user_id: reg_result[:user][:id], uid: uid, extra: auth_hash.extra)
|
||||
|
||||
Reference in New Issue
Block a user