pdf-quiz-generator/backend/app
Daniel b2a75b9e08
Some checks failed
Tests / backend (push) Failing after 5s
Tests / frontend (push) Failing after 37s
Tests / e2e (push) Failing after 38s
feat: signed in over there, signed in here
Opening one PedsHub app while already signed in at the provider for the
other one should not produce a sign-in page. It asks the provider once,
with prompt=none — "do you already know this person?" — and if the
answer is yes the round trip finishes with no screen and no click.

The refusal is the interesting half. login_required,
interaction_required, consent_required and account_selection_required
are the provider saying nobody is signed in, which is an answer rather
than a failure: the visitor lands on the page they asked for, with no
message and no sign of having been anywhere. Anything else still goes to
/login?error=sso_failed, and a silent attempt that throws is swallowed
too — nobody should be interrupted by a request they did not make.

The whole risk in this is a loop between two sites, so: at most one
attempt per browser session, never after somebody has signed themselves
out, and never inside a native shell where there is no third-party
cookie to carry the provider's session. Signing out sets a marker that
outlives the tab; pressing any sign-in control clears it, because that
is a person saying they have changed their mind.

A deep link survives the trip. The intended path rides in the server
session rather than the URL, and is validated on the way back — a
scheme, a host or a protocol-relative //evil all collapse to "/",
because a sign-in round trip is exactly where an open redirect would
live.

Verified against the live provider: /api/auth/sso/login?prompt=none
answers 302 to Authentik carrying prompt=none, state and nonce, and a
visitor with no session anywhere lands on the landing page with the
attempt marked spent.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TqXevQJhxFrM7jJg82cgZN
2026-09-13 17:09:46 +02:00
..
api feat: a versioned API, refresh tokens, and an end-to-end stack that found four bugs 2026-09-13 01:23:38 +02:00
middleware Add comprehensive structured logging with Loki + Grafana 2026-04-11 02:53:54 +02:00
models feat: no invite codes and no email sign-in codes — that is the provider's job 2026-09-13 13:56:48 +02:00
routers feat: signed in over there, signed in here 2026-09-13 17:09:46 +02:00
schemas feat: no passwords here — sign-in belongs to the provider 2026-09-13 15:50:38 +02:00
services feat: AI Mode gives the same answer twice, and a typo no longer empties the library 2026-09-13 16:24:48 +02:00
tasks feat: AI Mode gives the same answer twice, and a typo no longer empties the library 2026-09-13 16:24:48 +02:00
utils feat: the bank belongs to a role, not to a person 2026-09-13 13:26:25 +02:00
__init__.py Initial commit: PDF Quiz Generator app 2026-03-30 20:04:53 +00:00
cli.py refactor: remove the LMS 2026-09-12 23:27:51 +02:00
config.py feat: 20 MB on an upload, and delete one where they are listed 2026-09-13 16:12:29 +02:00
database.py Tag filtering, multi-category, bug fixes, image validation, docs 2026-04-04 22:48:26 +02:00
logging_config.py Add comprehensive structured logging with Loki + Grafana 2026-04-11 02:53:54 +02:00
main.py feat: AI Mode gives the same answer twice, and a typo no longer empties the library 2026-09-13 16:24:48 +02:00