mirror of
https://github.com/opf/openproject.git
synced 2026-06-14 03:30:14 +00:00
Render direct login button only when not logged in
This commit is contained in:
@@ -30,7 +30,7 @@
|
||||
|
||||
module Redmine::MenuManager::TopMenu::UserMenu
|
||||
def render_user_top_menu_node(items = first_level_menu_items_for(:account_menu))
|
||||
if omniauth_direct_login?
|
||||
if omniauth_direct_login? && !User.current.logged?
|
||||
render_direct_login
|
||||
else
|
||||
render_user_drop_down items
|
||||
|
||||
@@ -108,6 +108,9 @@ RSpec.describe "Omniauth authentication" do
|
||||
click_link_or_button "Sign In"
|
||||
|
||||
expect(current_path).to eql my_account_path
|
||||
|
||||
# Expect the dropdown menu to be the logged in one
|
||||
expect(page).to have_test_selector "op-app-header--user-menu-button"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user