sejal-gupta-ksolves opened a new pull request, #11868:
URL: https://github.com/apache/nifi/pull/11868

   # Summary
   
   [NIFI-15393](https://issues.apache.org/jira/browse/NIFI-15393)
   
   When an unauthenticated user opens a shared NiFi URL, the login flow does 
not preserve it, and after logging in the user lands on the root canvas instead 
of the requested page.
   
   This change captures the requested route when the user is redirected to the 
login page and navigates back to it after a successful login:
   
   - The URL is captured in the `navigateToLogIn$` effect. The auth interceptor 
already dispatches `navigateToLogIn` on a 401, so no change to 
`authentication.guard.ts` is needed.
   - The URL is read from `window.location.hash` rather than `router.url`. With 
`NavigationActionTiming.PostActivation`, `router.url` does not reflect the 
pending navigation, and the application uses hash routing.
   - `/login` and `/logout-complete` are not stored, so logging out and back in 
does not return the user to the logout-complete page.
   - Session storage access goes through a new `StorageService` that wraps 
`SessionStorageService`, so the storage key is defined in one place.
   - After login, `AccessEffects` navigates to the stored URL and removes it. 
If none is stored, it navigates to `/` as before.
   
   Only values starting with `/` are stored, and the stored URL is passed to 
`Router.navigateByUrl`, so the redirect stays inside the application.
   
   # Verification
   
   Run from `nifi-frontend/src/main/frontend` using Node 24 (the version in 
`package.json`):
   
   - [x] `npx nx test nifi --testFile=storage.service.spec.ts`
   - [x] `npx nx lint nifi`
   - [x] `npx prettier --check` on the changed files: passes
   - [x] `npx nx test nifi`
   - [x] `npx nx test shared`
   - [x] `./mvnw clean install -P contrib-check -pl nifi-frontend`


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to