DSpace 7.6 Remove 'Have you forgotten your password? link

158 views
Skip to first unread message

Nason Bimbe

unread,
Sep 20, 2023, 11:05:46 AM9/20/23
to DSpace Community
Hello - on our DSpace 7.6, we are using Shibboleth Authentication method. How can we remove the 'Have you forgotten your password?' link?

Thanks
Nason

Darryl Friesen

unread,
Sep 21, 2023, 5:08:45 PM9/21/23
to DSpace Community
I was just looking at this yesterday.  I think doing this "properly" might involve making some components themable that are not currently themable.  I found the password link in src/app/shared/log-in/log-in.component.html.  There's logic in that template to test if a user is authenticated and to check if registrations are allowed, but the code that creates the password recovery link has no checks.  I;m not exactly sure what logic should be there to determine if password recovery was a valid option, but I suspect that might be the place.

Rather than spend a lot of time making that themable, I just made a crappy hack to the core DSpace code to hide the menu divider and the password link.  In src/app/shared/log-in/log-in.component.scss I added the following CSS

div.dropdown-divider, a.dropdown-item {
  display: none
}

This will leave just the Shibboleth button on that log-in dropdown, assuming that like us you only support Shib auth and not others.  I also copied the app/shared/auth-nav-menu component files from the custom theme into my own, then adjusted the size of the login menu by changing this CSS in src/themes/limestone/app/shared/auth-nav-menu/auth-nav-menu.component.scss (limestone is the name of our theme)

.loginDropdownMenu {
  min-height: 120px;
}


An alternative method I thought about was making a change to my theme's auth-nav-menu.component.html template and remove the Login dropdown and just have it display the Shib login link when the user is not authenticated.  That was more work that just hacking the CSS so I haven't done that yet.

- Darryl

Nason Bimbe

unread,
Sep 25, 2023, 8:01:02 AM9/25/23
to DSpace Community
Thank you  Darryl - I will give a go.

Nason

Reply all
Reply to author
Forward
0 new messages