Authenticated /app live_session with current_scope and app shell #10

Open
opened 2026-09-26 13:58:30 +00:00 by belvedere · 0 comments
Collaborator

Objective: The protected shell every study screen lives inside.

Files:

  • Modify: lib/first_thousand_words_web/router.ex (new live_session)
  • Modify: lib/first_thousand_words_web/components/layouts.ex (app nav, user menu)
  • Create: lib/first_thousand_words_web/live/dashboard_live.ex (placeholder landing)

Steps:

  1. Add live_session :authenticated, on_mount: [...AshAuthentication.Phoenix.LiveSession] and
    put /app/... routes inside it.
  2. Ensure every authenticated LiveView renders <Layouts.app flash={@flash} current_scope={@current_scope}>
    as the first template element, per AGENTS.md.
  3. Build the nav: Dashboard, Practice, Decks, Languages, account menu.

Verify: signed out, /app redirects to sign-in; signed in, the shell renders with the
user's email in the menu.

Pitfalls (from AGENTS.md): never call <.flash_group> outside layouts.ex; never access a
changeset directly in a template — drive forms from a to_form/2 assign.

**Objective:** The protected shell every study screen lives inside. **Files:** - Modify: `lib/first_thousand_words_web/router.ex` (new `live_session`) - Modify: `lib/first_thousand_words_web/components/layouts.ex` (app nav, user menu) - Create: `lib/first_thousand_words_web/live/dashboard_live.ex` (placeholder landing) **Steps:** 1. Add `live_session :authenticated, on_mount: [...AshAuthentication.Phoenix.LiveSession]` and put `/app/...` routes inside it. 2. Ensure every authenticated LiveView renders `<Layouts.app flash={@flash} current_scope={@current_scope}>` as the first template element, per AGENTS.md. 3. Build the nav: Dashboard, Practice, Decks, Languages, account menu. **Verify:** signed out, `/app` redirects to sign-in; signed in, the shell renders with the user's email in the menu. **Pitfalls (from AGENTS.md):** never call `<.flash_group>` outside `layouts.ex`; never access a changeset directly in a template — drive forms from a `to_form/2` assign.
Sign in to join this conversation.
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
nickkeers/first-thousand-words#10
No description provided.