Lesson 5 — Scoping board access
Flash messages render as dismissible Alert components between the
nav and the main content. They disappear on the next navigation or
when dismissed.
Updating the boards index
The boards index currently shows all boards. Scope the heading and empty state to the signed-in user:
|
|
Verify the full auth flow
Test each path in order:
- Visit
/— should redirect to/session/new - Sign up at
/registration/new— should land on boards index - Sign out — should redirect to sign in
- Sign in — should land on boards index
- Request password reset — should redirect to sign in with notice
- Create a board — should appear in index, scoped to current user
- Open a second browser, sign in as a different user — should see only their own boards
Module 10 summary
- Rails 8’s
authenticationgenerator produces readable, ownable code —has_secure_password, aSessionmodel, anAuthenticationconcern, and password reset viagenerates_token_for - Auth views are Phlex —
Sessions::New,Passwords::New,Passwords::Edit, andRegistrations::Newall use the existingTextInputandButtoncomponents - A minimal layout in
Views::Base#render_minimal_layoutgives auth pages a clean, focused screen without the app nav current_userin components is provided bydef current_user = helpers.current_userinComponents::Baseowned_boardsscopes board creation and lookup to the current useradd_owner_as_membercallback ensures every board creator has an admin membership record- Card and column controllers verify board ownership via a
verify_board_accessbefore_action - Flash messages render as dismissible
Alertcomponents inAppLayout
What’s deferred
Board membership, invitations, and role-based access control are
covered in the companion Rails 8 Authentication deep-dive tutorial.
That tutorial picks up where this module leaves off — adding shared
boards, invitation emails, and a BoardPolicy for fine-grained
access control.
Views built this module
Views::Sessions::NewViews::Passwords::NewViews::Passwords::EditViews::Registrations::New
KanbanFlow progress
KanbanFlow is now a real multi-user application. Users have their own
accounts, their own boards, and can’t see each other’s data. The
current_user stub is gone. Authentication protects every page. The
app is ready for the finishing touches in Module 11.
Up next
[[11-finishing-touches|Module 11 — Finishing touches]] — error pages, empty states, accessibility audit, deployment preparation, and a review of everything KanbanFlow has become.
Tags: #phlex #rails #authentication #multiuser #kanbanflow
#tutorial