Front refactor: SP1 — login + register no design novo#142
Merged
Conversation
useLogin/useRegister/useRequestInvite mutations over apiFetch, plus isLikelyEmail (regex verbatim from the legacy portal login.js, on trimmed input). Unit-tested. These power the new public /app/login/ + /app/register/ routes, which live outside the (app) Protected group. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Public auth routes at /app/login/ and /app/register/ (siblings of the (app)
group, so NO Protected guard; they inherit only the root Providers layout).
Refined Editorial: AuthCard (brand → public /, serif title), EmailField,
LinkSentPanel.
- Login: client-side email gate (no API call when invalid), "Enviar link de
acesso" → busy "Enviando…", success panel, "Sem conexão" on network fail,
server {error} surfaced; link "Solicitar convite →" → /app/register/.
- Register: "Tenho convite" (invite_code+email → POST /portal/register → #sent)
and "Pedir convite" (email+note → /portal/request-invite) tabs; prefill from
?invite/?email and ?error=link expired notice (useSearchParams, Suspense-wrapped
for output:export).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The 401 handler (apiFetch default + Protected) now redirects to /app/login/ instead of /login, since the new login page lives inside the /app build as a public route. The api.test.ts default-handler reset is self-contained and asserts no specific path, so it is unaffected. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Builds against the static export (out/app/). Mocks /portal/login, /portal/register, /portal/request-invite. Asserts: client validation blocks an invalid email (no POST), a valid email → "Link enviado", a network failure → "Sem conexão", register invite happy → #sent, ?invite/?email prefill + invite-tab activation, ?error=link expired notice, waitlist request. No horizontal overflow on both routes at 360px and 1440px. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Login e register em /app/login e /app/register (Refined Editorial), guarda repontada. 223 testes, 103 e2e.
🤖 Generated with Claude Code