You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 88b620e
Browse filesBrowse the repository at this point in the historyBrowse files
authored
fix(hub): preserve requested page through sign-in (#250)
<!-- Use a conventional commit-style title, such as "fix(hub): retain
prototype history". -->
## Why
<!-- Explain the problem and why this change matters in a short,
plain-English paragraph. Link the issue when applicable. -->
Opening a Hub Create link while signed out loses the requested page.
After GitHub sign-in, Hub sends the user to its default destination
instead. Hub only saved canvas pairing requests, and its sign-in
callback only accepted preview authorization or pairing destinations.
## What changes
<!-- Describe what becomes different for a first-time reader. Explain
necessary terms. Include accurate Mermaid diagrams when they clarify the
proposal, using before/after diagrams when helpful. Add screenshots for
meaningful UI changes. -->
<!-- Omit validation sections, checklists, and routine test/CI summaries
such as "CI is green" or "tests passed". Mention only known verification
gaps that affect the change, not disclaimers about drafting this
description. -->
<!-- For UI changes, prune obsolete and duplicate stories in the
affected catalogues as part of the change. Explain removed UI or
consolidated coverage where needed; see
hub/docs/storybook.md#ui-changes-and-pull-request-evidence. -->
Hub remembers the requested internal page and query through sign-in,
including Create. GitHub and local sign-in share destination validation,
which rejects external URLs and unsafe paths. Only GET destinations are
saved, and the destination still requires its usual access checks.
Sign-ins without a saved destination keep their existing welcome or
repository landing page.
Adds regression coverage for Create links, default destinations,
repository access, unsafe redirects, and local sign-in. This changes
Replica Hub only; it does not change the migration modal in
github/prototyping#3604.
The full Create flow and normal-browser authentication remain
unverified. Local checks were blocked by npm TLS connection failures
that left Vite assets unavailable; local repository fixtures also
reported Git errors. Browser verification requires this branch on a
configured GitHub-backed Hub.
---------
Co-authored-by: Catharine McNally <2089974+cmcnally@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copy file name to clipboardExpand all lines: hub/docs/authentication-and-repository-authorization.md
+3-1Lines changed: 3 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,7 +12,9 @@ Session -> Hub asks GitHub for current permission -> show repository or deny acc
12
12
13
13
Hub admits repository users when they can read at least one installed repository. A `none` permission on another installed repository does not prevent sign-in. Explicitly enrolled Hub operators can also sign in to administer the deployment without repository access. Hub stores their GitHub ID and current profile, but not their OAuth token. The browser cookie points to a `Session` record that Hub deletes when the person signs out.
14
14
15
-
Signed-in visits to `/` and successful sign-ins go to `/repositories`, regardless of Hub administrator status. Sign-in preserves a saved preview authorization or canvas pairing destination. The repository entry point opens the first readable repository or returns not found when none is available. Hub administrators can still open `/security_audit` directly.
15
+
Signed-out visits to protected pages save the requested internal path and query for after sign-in, including Create, preview authorization, and canvas pairing. Hub consumes the saved destination before rotating the browser session and rejects external URLs, protocol-relative paths, backslashes, whitespace, and control characters. Only GET destinations are saved; sign-in never replays a mutation. The destination still requires its normal access checks.
16
+
17
+
Without a saved destination, a successful sign-in opens the welcome page for a new user or `/repositories` for a returning user, regardless of Hub administrator status. Signed-in visits to `/` go to `/repositories`. The repository entry point opens the first readable repository or returns not found when none is available. Hub administrators can still open `/security_audit` directly.
16
18
17
19
Before showing a repository, Hub confirms that its App is still installed there and asks GitHub whether the signed-in person can access it. Hub also confirms that GitHub's answer belongs to that person.
0 commit comments