pdf-quiz-generator/backend/alembic/versions/r7b8c9d0e1f2_drop_code_tables.py
Daniel cf2f42975e
Some checks failed
Tests / backend (push) Failing after 8s
Tests / frontend (push) Successful in 33s
Tests / e2e (push) Failing after 33s
feat: no invite codes and no email sign-in codes — that is the provider's job
Both were this app doing an identity provider's work. Sign-in and
sign-up happen at sso.pedshub.com now: it takes the address, sends the
code, checks it, and knows about second factors — none of which belongs
here, and two of which were never done here at all.

Gone: services/invites.py, services/login_codes.py,
routers/login_code.py, the two models, the three admin invite routes,
the invite_only flag and its switch, the invite field on both sign-up
forms, and the code half of the sign-in page — which was the primary way
in and is now a button that says "Sign in with PedsHub SSO". The
password form stays for a site with no provider configured.

Migration r7b8c9d0e1f2 drops invite_codes (three spent rows) and
login_codes (empty). The dump beside it has both.

585 tests, and the contract snapshot is 320 routes — five fewer, all
five named in the diff so the removal is reviewable rather than
discovered later by a client.

Also: "Make a deck" in the signed-in menu and on the landing page, going
to the scribe's My Resources at app.pedshub.com/#resources. Same
sign-in on both sides; the arrow says it leaves.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TqXevQJhxFrM7jJg82cgZN
2026-09-13 13:56:48 +02:00

31 lines
945 B
Python

"""Sign-up codes and email sign-in codes, gone.
Both were the app doing an identity provider's job. Sign-in is through
sso.pedshub.com now: it takes the email, sends the code, checks it, and knows
about second factors — none of which this app should be reimplementing, and
two of which it never did.
invite_codes held three rows, all of them spent or stale; login_codes held
none. The dump taken beside this change has both if anybody ever wants to know
who was invited.
Revision ID: r7b8c9d0e1f2
Revises: q6a7b8c9d0e1
"""
from alembic import op
revision = "r7b8c9d0e1f2"
down_revision = "q6a7b8c9d0e1"
branch_labels = None
depends_on = None
def upgrade():
op.execute("DROP TABLE IF EXISTS login_codes")
op.execute("DROP TABLE IF EXISTS invite_codes")
def downgrade():
# The tables can be recreated from the models in git history; their
# contents cannot, and inventing an invite is worse than not having one.
pass