Skip to content

fix/NI-189-login-logic - #120

Open
pwadmore-ea wants to merge 16 commits into
developmentfrom
fix/NI-189-login-logic
Open

fix/NI-189-login-logic#120
pwadmore-ea wants to merge 16 commits into
developmentfrom
fix/NI-189-login-logic

Conversation

@pwadmore-ea

Copy link
Copy Markdown
Contributor

@github-actions

Copy link
Copy Markdown

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@pwadmore-ea pwadmore-ea self-assigned this Jul 21, 2026
@pwadmore-ea
pwadmore-ea marked this pull request as ready for review July 21, 2026 20:10
Copilot AI review requested due to automatic review settings July 21, 2026 20:10

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the post-login redirect mechanism to avoid carrying the destination in URLs by storing the intended destination server-side (cache) and using an opaque, short-lived redirectToken HttpOnly cookie to retrieve it after Azure AD login.

Changes:

  • Store unauthenticated users’ current path in a cache keyed by a UUID token and set the token in an HttpOnly redirectToken cookie.
  • Update /login handler to resolve the token to a redirect path, clear the cookie, and drop the cached token.
  • Add config/documentation/tests for redirect-token TTL and the new redirect behavior; remove redirectTo from the login link.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
test/routes/index-happy.js Adds integration-style tests for cookie behavior and login fallback redirect.
test/routes/auth.js Adds unit tests for /login handler error and redirect-token resolution behavior.
test/config.js Adds tests for redirect-token TTL derivation and validation.
server/views/layout.html Removes redirectTo query parameter from the login link.
server/routes/auth.js Switches login handler to async and redirects via cached redirect token.
server/index.js Adds redirect-token cookie + cache policy, and sets cookie during view responses for unauthenticated requests.
server/config.js Adds redirect token TTL config and derived redirectTokenTtlMs.
readme.md Documents REDIRECT_TOKEN_TTL_MINUTES.
docker/.env.example Documents redirect-token TTL env var usage.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread server/index.js
Comment thread server/routes/auth.js
Comment thread server/config.js Outdated
@pwadmore-ea
pwadmore-ea force-pushed the fix/NI-189-login-logic branch from 5c706f3 to cd25c9b Compare July 21, 2026 20:39
@pwadmore-ea
pwadmore-ea marked this pull request as draft July 21, 2026 20:48
@pwadmore-ea
pwadmore-ea requested a review from Copilot July 21, 2026 20:49

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.

Comment thread server/routes/auth.js Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.

Comment thread server/index.js

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated no new comments.

@pwadmore-ea
pwadmore-ea force-pushed the fix/NI-189-login-logic branch from 8915168 to e79ea67 Compare July 22, 2026 13:28
@sonarqubecloud

Copy link
Copy Markdown

@pwadmore-ea
pwadmore-ea marked this pull request as ready for review July 22, 2026 14:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants