Skip to content

[auth] guard blog/email server actions with requireAdmin() #78

Description

@WilliamTayNZ

Important: When you begin this ticket, create a new branch from feat/admin-auth and not main. When you open a PR, open it into feat/admin-auth and not main.

Description

The blog and email server actions in the admin panel currently rely solely on proxy for auth protection. Server actions can technically be invoked via direct POST requests, so each one should also verify the session itself as defense-in-depth.

Acceptance Criteria

  • createBlogPost server action calls requireAdmin() before any other logic
  • sendEmail server action calls requireAdmin() before any other logic
  • Both actions redirect to /admin/login when called without a valid session

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Fields

No fields configured for Task.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions