Bỏ qua, tới nội dung chính

Kiến trúc · ADR 0023

Modal sign-in/up with social-login placeholders

Trạng thái
accepted
Ngày
2026-09-27
Người quyết định
Alex

Context

ADR-0021 chose email + password self-registration and dropped Google OAuth; DESIGN-DNA §7 rejected a sign-in modal in favour of a linkable /login page. The owner has since asked for the reference template's modal sign-in/sign-up — a popup opened from the header, with Google/Apple/Twitter buttons — as the primary entry point.

Decision

  • Sign-in and sign-up are a modal opened from the header, reusing the same LoginForm/ RegisterForm that back the pages. The /login and /register pages stay: middleware redirects (/login?next=…) and no-JS access still land on a real page. Modal and page are two shells around one form. This supersedes the DESIGN-DNA §7 "no modal" row (now removed).
  • Social buttons are visual placeholders. Google (prominent), Apple and Twitter render in the modal but are not wired to OAuth; clicking shows an inline "đang được phát triển" note. Real Google OAuth remains deferred (ADR-0021). No OAuth dependency is added.
  • "Trở thành giảng viên" is restored as a header entry to a /become-tutor page whose CTA opens the register modal. Because self-registration is STUDENT-only (ADR-0021), the copy is honest: create an account, then request instructor access from an admin — no one-click teacher account.

Consequences

  • The auth UX matches the template while the real, tested email+password flow is unchanged underneath. Accessibility is preserved: the modal is a real dialog (focus trap, Escape, focus return, scroll lock), and every flow still works as a page without JavaScript.
  • When Google OAuth is actually built, only the placeholder buttons change; the modal and forms stay.