Skip to content

feat: Legacy first-login onboarding gate (/welcome ORCID completion) #129

Open

Description

@neuromechanist

Summary

Frontend for the legacy first-login onboarding gate. Legacy nemar.org users (imported with name + email only) sign in via the existing email-PIN flow, then must link a verified ORCID before reaching the dashboard.

This is the email-first mirror of the ORCID-first onboarding in #128. Pairs with the backend in nemarOrg/nemar-cli#833. Builds on #128 (ORCID button + link route) and reuses the passwordless flow already shipped. Related: #44 (net-new web signup).

Decisions (locked)

  • ORCID required to finish; GitHub deferred to first publish (a nudge here, not a blocker).
  • Auto-approve on completion.
  • Email-PIN stays as the second sign-in method on /login.

Behavior

  1. /auth/me exposes onboarding_required (nemar-cli#833). When true, src/middleware.ts redirects app routes (dashboard / upload / settings) to /welcome until completion.
  2. /welcome.astro (today pure orientation copy) becomes a completion gate when onboarding_required:
  3. Non-legacy users: /welcome stays orientation-only (no gate).

Reuse / non-goals

  • No GitHub OAuth: the handle is a plain validated string collected at publish time (existing flow).
  • Do not remove the email-PIN UI; it is the permanent fallback.

Done means

  • Imported legacy user: email-PIN sign-in -> forced /welcome -> link ORCID -> finish -> dashboard, with ORCID now primary and the PIN still working.

Activity

  1. neuromechanist commented on Jun 22, 2026

    @neuromechanist
    ContributorAuthor

    Generalized: profile-completion gate (frontend), tiered

    Reframe the /welcome gate from "legacy onboarding only" to a profile-completion gate driven by profile_complete from /auth/me (see nemarOrg/nemar-cli#833). Serves new ORCID signups and the legacy migration with the same UI.

    Behavior

    • src/middleware.ts reads profile_complete (+ missing) from /auth/me. When incomplete, gate by action, not globally (graceful):
      • Accessing/downloading data without city/country -> redirect to the completion form.
      • Publishing without a GitHub handle -> prompt for it at publish time.
      • Browsing/exploring stays open.
    • Completion form: reuse the ORCID complete form (src/pages/auth/orcid/complete.astro) for logged-in users too — collect city/country (required) + affiliation (optional), link ORCID if not yet linked. Name is never typed — it's auto-filled from ORCID.
    • Legacy users land here on their first email-PIN login and complete in place.

    Already shipped

    Remaining (this issue)

    • Middleware: read profile_complete, do the tiered redirect (data-access -> completion; publish -> GitHub prompt).
    • A logged-in completion page/state (distinct from the brand-new-signup complete.astro path) collecting only the missing fields.
    • Wire it so legacy email-PIN logins are gated to completion.
  2. neuromechanist commented on Aug 3, 2026

    @neuromechanist
    ContributorAuthor

    Scope overlap with #226 — flagging so these two don't get built twice with different answers.

    The generalized "profile-completion gate" in the comment above and #226 are solving the same problem, and the owner decisions recorded on #226 (2026-08-02) change two of the answers here:

    this issue's generalized comment #226 (later, owner-decided)
    Where city/country is enforced at data access / download at upload only; browsing and downloading stay open
    Completion surface a new logged-in completion page /settings, which already has the fields and the notice
    Prompt for incomplete profiles tiered redirect from middleware dismissible dashboard banner
    GitHub handle prompt at publish unchanged — required at publish, not before

    Where they still differ genuinely: #226 says nothing about legacy email-PIN first login, which is this issue's original subject. That is the part of #129 that survives.

    So the split I'd suggest, unless you want it otherwise:

    Not closing either; this needs your call on whether the legacy track is still wanted at all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions