Description
After accepting the End User Agreement (EUA) on first login, the page shows an infinite spinner and never redirects to the original destination.
Environment
- DSpace version: 9.x
- dspace-angular version: 9.x
Steps to reproduce
- Create a new user (or administrator) who has never accepted the End User Agreement
- Log in for the first time
- The EUA page appears at
/info/end-user-agreement?redirect=%252Fhome
- Check "I Accept" and click Submit
- Page shows infinite spinner — never redirects
Expected behavior
After accepting the EUA, the user is redirected to the original destination (e.g. /home).
Actual behavior
The PATCH to /api/eperson/epersons/{uuid} succeeds — dspace.agreements.end-user=true is correctly saved in the database. However, the frontend shows an infinite spinner.
On the next login, the user enters directly without seeing the EUA page, confirming the acceptance was saved correctly.
Root cause (investigated)
After the PATCH, the Angular Redux store reloads the user. During this brief window the store has no user (or stale user without the updated metadata) → the EUA guard fires again on the redirect to /home → redirects back to /info/end-user-agreement (this time without the redirect param) → spinner.
Double-encoding side note: The redirect URL is built in authorized.operators.ts with encodeURIComponent(redirect), but Angular already encodes query param values when building the URL → results in redirect=%252Fhome instead of redirect=%2Fhome. The decodeURIComponent() in end-user-agreement.component.ts correctly undoes this, so the double encoding is not the direct cause of the spinner — it is however confusing and worth fixing independently.
Relevant files
src/app/core/end-user-agreement/end-user-agreement.guard.ts
src/app/core/end-user-agreement/end-user-agreement.service.ts
src/app/info/end-user-agreement/end-user-agreement.component.ts — submit() method
src/app/core/shared/authorized.operators.ts — returnEndUserAgreementUrlTreeOnFalse
Workaround
Log out and log in again after the spinner appears. The EUA will not be shown again on subsequent logins.
Description
After accepting the End User Agreement (EUA) on first login, the page shows an infinite spinner and never redirects to the original destination.
Environment
Steps to reproduce
/info/end-user-agreement?redirect=%252FhomeExpected behavior
After accepting the EUA, the user is redirected to the original destination (e.g.
/home).Actual behavior
The
PATCHto/api/eperson/epersons/{uuid}succeeds —dspace.agreements.end-user=trueis correctly saved in the database. However, the frontend shows an infinite spinner.On the next login, the user enters directly without seeing the EUA page, confirming the acceptance was saved correctly.
Root cause (investigated)
After the PATCH, the Angular Redux store reloads the user. During this brief window the store has no user (or stale user without the updated metadata) → the EUA guard fires again on the redirect to
/home→ redirects back to/info/end-user-agreement(this time without theredirectparam) → spinner.Double-encoding side note: The redirect URL is built in
authorized.operators.tswithencodeURIComponent(redirect), but Angular already encodes query param values when building the URL → results inredirect=%252Fhomeinstead ofredirect=%2Fhome. ThedecodeURIComponent()inend-user-agreement.component.tscorrectly undoes this, so the double encoding is not the direct cause of the spinner — it is however confusing and worth fixing independently.Relevant files
src/app/core/end-user-agreement/end-user-agreement.guard.tssrc/app/core/end-user-agreement/end-user-agreement.service.tssrc/app/info/end-user-agreement/end-user-agreement.component.ts—submit()methodsrc/app/core/shared/authorized.operators.ts—returnEndUserAgreementUrlTreeOnFalseWorkaround
Log out and log in again after the spinner appears. The EUA will not be shown again on subsequent logins.