Protect `/admin`

About 45 minutesYou need: adjoas-kitchen open in Cursor with npm run dev running, Chrome, and your password manager
This video is in the full courseGet the course to watch every video and read every lesson in full. GHS 399, paid once.Get the course · GHS 399
Video · 15:11
Goal

Lock /admin so anyone who isn't the signed-in owner is sent to /login: checked at the door by proxy.ts, checked again inside the page, and checked again in every admin action.

Why this matters

Right now, /admin is a room with a sign on the door that says "Owner only", and no lock. In Lesson 9.6 that room will hold every customer's name, phone number and order. Before anything private goes in, the lock goes on.

You'll also learn the single most important idea in web security: never rely on one lock. Professional developers check permission in several places, so that one mistake (a typo, a renamed file, a setting someone changed) doesn't open everything. Next.js's own documentation says the same: check who's asking inside each page and action, not only at the door. By the end of this lesson, you'll have proven each lock works on its own.

In the full lesson

  1. The idea in plain English
  2. Do it
  3. Check it worked
  4. Understand what AI wrote
  5. Quick check
  6. What you can do now
Stage 2 · Make it workYou’ve seen the why. The how is in the course.

The step-by-step, the prompt to copy, the video and the check-it-worked list, for every lesson in all 15 modules. GHS 399 ($40), paid once by mobile money or card, yours to keep.

Get the course · GHS 399See what’s inside
Already have the course? Open the full lesson