瀏覽代碼

If login redirects to omniauth, redirect logout to root_path (#6694)

Fix #6670
master
Eugen Rochko 6 年之前
committed by GitHub
父節點
當前提交
a29d409e20
沒有發現已知的金鑰在資料庫的簽署中 GPG 金鑰 ID: 4AEE18F83AFDEB23
共有 1 個檔案被更改,包括 10 行新增3 行删除
  1. +10
    -3
      app/controllers/auth/sessions_controller.rb

+ 10
- 3
app/controllers/auth/sessions_controller.rb 查看文件

@@ -12,10 +12,9 @@ class Auth::SessionsController < Devise::SessionsController

def new
Devise.omniauth_configs.each do |provider, config|
if config.strategy.redirect_at_sign_in
return redirect_to(omniauth_authorize_path(resource_name, provider))
end
return redirect_to(omniauth_authorize_path(resource_name, provider)) if config.strategy.redirect_at_sign_in
end

super
end

@@ -59,6 +58,14 @@ class Auth::SessionsController < Devise::SessionsController
end
end

def after_sign_out_path_for(_resource_or_scope)
Devise.omniauth_configs.each_value do |config|
return root_path if config.strategy.redirect_at_sign_in
end

super
end

def two_factor_enabled?
find_user.try(:otp_required_for_login?)
end


Loading…
取消
儲存