feat(web): sign in locally without Ricochet #105

Closed
jalenluorion wants to merge 2 commits from feat/dev-signin-8090 into main
Member

Local sign-in no longer needs Ricochet, so the manual setup drops Rust, cargo install and the third terminal. Replaces #99.

How: the cal-dev Keycloak client only returns to http://localhost:8090/oauth2/callback. The dev server now listens on 8090 itself, and a new /oauth2/callback route passes the query (code, state, iss, ...) on unchanged to /api/auth/callback, which is what Ricochet does. It redirects rather than calling the handler directly because the login cookie is scoped to /api/auth. The route returns 404 in production, where Keycloak goes through the real Ricochet at oauth.scottylabs.org; prod and staging are unchanged.

  • npm run dev runs next dev --turbo -p 8090; APP_URL in web/.env.development and web/.env.example is http://localhost:8090. OAUTH_RELAY_URL is unchanged.
  • The API's default CORS origins add localhost:8090 (the dev secret already has it).
  • The getting-started guide and README drop the Ricochet install and point at localhost:8090.
  • Also carries #99's devenv fix (bump only the git-hooks input), without which devenv shell and every CI run fail since the Oct 19 lockfile update. The newer formatters normalize a few Markdown files and api/pyproject.toml (whitespace only there).

Tested: with no Ricochet running, the API plus npm run dev signed in through Keycloak and landed on localhost:8090 with my courses and calendar. tsc, eslint, prettier, vitest (26/26), ruff, and prek run --all-files (gitleaks included) pass.

On merge: the dev FRONTEND_REDIRECT_URI in OpenBao moves to http://localhost:8090 so the Google Calendar connect flow returns to the right port.

Local sign-in no longer needs Ricochet, so the manual setup drops Rust, `cargo install` and the third terminal. Replaces #99. **How:** the `cal-dev` Keycloak client only returns to `http://localhost:8090/oauth2/callback`. The dev server now listens on 8090 itself, and a new `/oauth2/callback` route passes the query (`code`, `state`, `iss`, ...) on unchanged to `/api/auth/callback`, which is what Ricochet does. It redirects rather than calling the handler directly because the login cookie is scoped to `/api/auth`. The route returns 404 in production, where Keycloak goes through the real Ricochet at oauth.scottylabs.org; prod and staging are unchanged. - `npm run dev` runs `next dev --turbo -p 8090`; `APP_URL` in `web/.env.development` and `web/.env.example` is `http://localhost:8090`. `OAUTH_RELAY_URL` is unchanged. - The API's default CORS origins add `localhost:8090` (the dev secret already has it). - The getting-started guide and README drop the Ricochet install and point at localhost:8090. - Also carries #99's devenv fix (bump only the `git-hooks` input), without which `devenv shell` and every CI run fail since the Oct 19 lockfile update. The newer formatters normalize a few Markdown files and `api/pyproject.toml` (whitespace only there). **Tested:** with no Ricochet running, the API plus `npm run dev` signed in through Keycloak and landed on localhost:8090 with my courses and calendar. tsc, eslint, prettier, vitest (26/26), ruff, and `prek run --all-files` (gitleaks included) pass. **On merge:** the dev `FRONTEND_REDIRECT_URI` in OpenBao moves to `http://localhost:8090` so the Google Calendar connect flow returns to the right port.
The Oct 19 lockfile update moved kennel to a version that enables the
gitleaks hook from git-hooks.nix, but git-hooks stayed on a Sep 27 revision
that predates it, so every devenv shell and CI run failed to evaluate. The
newer formatters reformat a few Markdown files and pyproject.toml
(whitespace and indentation only).
feat(web): sign in locally without Ricochet
Some checks failed
ci.yml / feat(web): sign in locally without Ricochet (pull_request) Failing after 0s
nixbot/nix-eval evaluation succeeded in 0s
nixbot/nix-build 0 attributes built
f341893542
The cal-dev Keycloak client only returns to localhost:8090/oauth2/callback,
so local sign-in needed Rust, a Ricochet install and a third terminal. The
dev server now listens on 8090 itself, and /oauth2/callback passes the query
on unchanged to /api/auth/callback, which is what Ricochet does. The route is
off in production, where the real Ricochet still serves the callback.
APP_URL and the API's default CORS origins move to localhost:8090.
Author
Member

Not needed with #104, where pitchfork starts Ricochet automatically.

Not needed with #104, where pitchfork starts Ricochet automatically.
jalenluorion closed this pull request 2026-11-21 22:43:14 +00:00
Some checks are pending
ci.yml / feat(web): sign in locally without Ricochet (pull_request) Failing after 0s
nixbot/nix-eval evaluation succeeded in 0s
Required
Details
nixbot/nix-build 0 attributes built
Required
Details
CI / checks*
Required
kennel/deploy
Required

Pull request closed

Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
ScottyLabs/cal!105
No description provided.