Hint
Authentication = who are you (identity); authorization = what are you allowed to do (permissions)
Authentication (AuthN) — verifying identity. "Who are you?"
Authorization (AuthZ) — determining permissions. "What are you allowed to do?"
admin role before showing /admin.On the frontend:
// Authentication check — are you logged in?
if (!user) return <Redirect to="/login" />;
// Authorization check — do you have permission?
if (!user.roles.includes('admin')) return <Forbidden />;
Key rule: never rely on frontend-only authorization checks for security. The server must enforce permissions on every request. Frontend checks are UX, not security.