Skip to content

Commit

Permalink
fix lgoin
Browse files Browse the repository at this point in the history
  • Loading branch information
qinmingyuan committed Nov 22, 2024
1 parent f400669 commit e556381
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions app/controllers/auth/sign_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@ class SignController < BaseController
before_action :check_login, except: [:logout]
skip_after_action :set_auth_token, only: [:logout]
before_action :set_oauth_user, only: [:bind, :direct, :bind_create, :sign]
before_action :set_account, only: [:login, :token]
before_action :set_account, only: [:token]
before_action :set_confirmed_account, only: [:sign, :login], if: -> { params[:identity].present? }

def sign
if params[:identity]
@account = Account.where(identity: params[:identity].strip).confirmed.with_user.take

if @account && @account.user && @account.user.password_digest.present?
render 'sign_login'
else
Expand Down Expand Up @@ -90,6 +89,10 @@ def set_account
@account = Account.find_by(identity: params[:identity].strip)
end

def set_confirmed_account
@account = Account.where(identity: params[:identity].strip).confirmed.with_user.take
end

def set_oauth_user
@oauth_user = OauthUser.find_by uid: params[:uid]
end
Expand Down

0 comments on commit e556381

Please sign in to comment.