Skip to content
This repository was archived by the owner on Apr 17, 2023. It is now read-only.

Commit 1daaf11

Browse files
mssolaflavio
authored andcommitted
ldap: don't show the "I forgot my password" link
Signed-off-by: Miquel Sabaté Solà <msabate@suse.com>
1 parent 0c0c5a1 commit 1daaf11

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

app/views/devise/sessions/new.html.slim

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,6 @@ section.row-0
2222
.row
2323
.col-sm-6.create-new-account
2424
= link_to 'Create a new account', new_user_registration_url, class: 'btn btn-link'
25-
.col-sm-6.forgot-password
26-
= link_to "I forgot my password", new_user_password_path, class: 'btn btn-link'
25+
- if !Portus::LDAP.enabled?
26+
.forgot-password
27+
= link_to "I forgot my password", new_user_password_path, class: 'btn btn-link'

spec/features/auth/login_feature_spec.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@
1818
APP_CONFIG["ldap"] = { "enabled" => true }
1919
visit new_user_session_path
2020

21+
expect(page).to_not have_content("Create a new account")
22+
expect(page).to_not have_content("I forgot my password")
23+
24+
APP_CONFIG["first_user_admin"] = { "enabled" => true }
25+
visit new_user_session_path
26+
2127
expect(page).to have_content("The first user to be created will have admin permissions !")
2228
expect(page).to_not have_content("Create a new account")
2329

0 commit comments

Comments
 (0)