Hi Tomas,

at least I can give you the location where this can be changed in the 
source code of the angular-frontend.

There is a component 
.../src/app/shared/log-in/methods/password/log-in-password.component.html 
that should look like this:

<form class="form-login" (ngSubmit)="submit()" [formGroup]="form" novalidate
>
  <label class="sr-only">{{"login.form.email" | translate}}</label>
  <input [attr.aria-label]="'login.form.email' |translate" autocomplete=
"off" autofocus
    class="form-control form-control-lg position-relative" formControlName=
"email"
    placeholder="{{'login.form.email' | translate}}" required type="email" 
[attr.data-test]="'email' | dsBrowserOnly">
  <label class="sr-only">{{"login.form.password" | translate}}</label>
  <input [attr.aria-label]="'login.form.password' |translate" autocomplete=
"off"
    class="form-control form-control-lg position-relative mb-3" 
placeholder="{{'login.form.password' 
| translate}}"
    formControlName="password" required type="password" 
[attr.data-test]="'password' 
| dsBrowserOnly">
  <div *ngIf="(error | async) && hasError" class="alert alert-danger" role=
"alert" @fadeOut>{{ (error | async) |
    translate }}</div>
  <div *ngIf="(message | async) && hasMessage" class="alert alert-info" role
="alert" @fadeOut>{{ (message | async) |
    translate }}</div>

  <button class="btn btn-lg btn-primary btn-block mt-3" type="submit" 
[attr.data-test]="'login-button' | dsBrowserOnly"
    [disabled]="!form.valid"><i class="fas fa-sign-in-alt"></i> 
{{"login.form.submit" | translate}}</button>
</form>

<div class="mt-2">
  <a class="dropdown-item" *ngIf="canRegister$ | async" [routerLink]=
"[getRegisterRoute()]"
    [attr.data-test]="'register' | dsBrowserOnly">
    {{ 'login.form.new-user' | translate }}
  </a>
  <a class="dropdown-item text-primary" [routerLink]="[getForgotRoute()]" 
[attr.data-test]="'forgot' | dsBrowserOnly">
    {{ 'login.form.forgot-password' | translate }}
  </a>
</div>

I assume that the ldap authentication method also uses this component, 
since there is no other component that uses the forgot password link.

Commenting out or deleting the last link in the html file ensures that the 
link is no longer displayed.

<a class="dropdown-item text-primary" [routerLink]="[getForgotRoute()]" 
[attr.data-test]="'forgot' | dsBrowserOnly">
    {{ 'login.form.forgot-password' | translate }}
  </a>

(You may want to copy the component into your own theme, but I have not 
tested whether further changes are then necessary.)

Kind regards,
Matthias
Tomas Hajek schrieb am Dienstag, 23. Januar 2024 um 15:38:17 UTC+1:

> Hi,
>   I'm currently running DSpace version 7.6.1 and using LDAP 
> authentication.  I'm wondering if there is a method of either removing 
> the "Have you Forgot your password?" link or being able to change the link 
> to point to another site. 
>   I saw a related issue (https://github.com/DSpace/DSpace/issues/8293) 
> but it looks like that is still on the "To Do" board for 7.6.x (
> https://github.com/orgs/DSpace/projects/29/views/1?filterQuery=8293).
>   I've attempted using an Apache HTTPD rewrite rule to redirect /forgot to 
> the password reset page that we want users to use but that only seems to 
> work if the user goes directly to the /forgot URL.  I'm guessing that when 
> a user clicks on the link under the "Login" drop-down that it is JavaScript 
> doing the URL change so it doesn't actually hit the Apache HTTPD server in 
> order to do a rewrite (although I could be doing it wrong).
>   My next attempt might be to change the forgot-password-form Angular 
> components in the theme but that might cause me other issues.
>   Does anyone have any suggestions?
> Thanks for your help!
>  -Tomas
>    
>
>

-- 
All messages to this mailing list should adhere to the Code of Conduct: 
https://www.lyrasis.org/about/Pages/Code-of-Conduct.aspx
--- 
You received this message because you are subscribed to the Google Groups 
"DSpace Technical Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dspace-tech+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dspace-tech/74930511-23d6-4aae-a80b-c2dc1dad83a0n%40googlegroups.com.

Reply via email to