Skip to content

feat(web): remove Decap CMS and add admin authentication foundation#2949

Merged
ComputelessComputer merged 3 commits intomainfrom
devin/1768030596-remove-decap-admin-auth
Jan 11, 2026
Merged

feat(web): remove Decap CMS and add admin authentication foundation#2949
ComputelessComputer merged 3 commits intomainfrom
devin/1768030596-remove-decap-admin-auth

Conversation

@devin-ai-integration
Copy link
Contributor

@devin-ai-integration devin-ai-integration bot commented Jan 10, 2026

Summary

This PR removes the existing Decap CMS admin system and lays the foundation for a new custom admin interface. This is the first PR in a series to implement issue #2948.

Removed:

  • All Decap CMS files (public/admin/config.yml, index.html, media-library.js, media.html, preview-styles.css, preview-templates.js, registration.js)
  • Netlify Identity redirect script and its reference in __root.tsx

Added:

  • Admin authentication with hardcoded email whitelist (src/functions/admin.ts)
  • Admin layout route with auth guard that redirects unauthenticated users to /auth and non-admins to /
  • Admin dashboard placeholder page at /admin
  • Media library placeholder page at /admin/media

Moved:

  • mdx-format-core.js from public/admin/ to scripts/ (still used by format-mdx.js)

Updates since last revision

  • Fixed route conflict by renaming _admin to admin. The underscore prefix creates a pathless layout route which conflicted with _view/index.tsx since both resolved to /. The admin routes now live at /admin/* as intended.

Review & Testing Checklist for Human

  • Verify the admin email whitelist in apps/web/src/functions/admin.ts contains the correct emails (currently: yujonglee@hyprnote.com, john@hyprnote.com, harshika@hyprnote.com)
  • Test the auth redirect flow: Visit /admin while logged out → should redirect to /auth with redirect param → after login, should return to /admin
  • Test non-admin access: Log in with a non-whitelisted email and visit /admin → should redirect to /
  • Verify format-mdx.js still works: Run node apps/web/scripts/format-mdx.js with MDX input to ensure the moved mdx-format-core.js is correctly imported

Recommended test plan:

  1. Deploy to staging/preview
  2. Test admin access with a whitelisted email
  3. Test admin access with a non-whitelisted email
  4. Verify the main site still works (no regressions from removing Netlify Identity script)

Notes

This is a breaking change for anyone currently using Decap CMS at /admin. The new admin interface is intentionally minimal - full media library and blog management features will come in subsequent PRs.

The handbook documentation was updated to describe the new admin system, but references features (Google Docs import, blog management) that are not yet implemented.

Requested by: @ComputelessComputer
Devin session: https://app.devin.ai/sessions/5c615647f58c421dabccc0cdd5b4270c

- Remove Decap CMS files (config.yml, index.html, media-library.js, etc.)
- Remove netlify-identity-redirect.js and its reference in __root.tsx
- Move mdx-format-core.js to scripts/ folder (still used by format-mdx.js)
- Add admin authentication with email whitelist
- Add admin layout route with auth guard
- Add admin dashboard and media library placeholder pages
- Update handbook documentation to reflect new admin system

Co-Authored-By: john@hyprnote.com <john@hyprnote.com>
@devin-ai-integration
Copy link
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR that start with 'DevinAI' or '@devin'.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@netlify
Copy link

netlify bot commented Jan 10, 2026

Deploy Preview for hyprnote ready!

Name Link
🔨 Latest commit f473b69
🔍 Latest deploy log https://app.netlify.com/projects/hyprnote/deploys/6963b2f9f3e9610008619eb8
😎 Deploy Preview https://deploy-preview-2949--hyprnote.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link

netlify bot commented Jan 10, 2026

Deploy Preview for hyprnote-storybook canceled.

Name Link
🔨 Latest commit f473b69
🔍 Latest deploy log https://app.netlify.com/projects/hyprnote-storybook/deploys/6963b2f9ebaacb0008a2b92f

@netlify
Copy link

netlify bot commented Jan 10, 2026

Deploy Preview for howto-fix-macos-audio-selection canceled.

Name Link
🔨 Latest commit f473b69
🔍 Latest deploy log https://app.netlify.com/projects/howto-fix-macos-audio-selection/deploys/6963b2f938c0230008d5783e

The _admin prefix creates a pathless layout route which conflicts with
_view's index.tsx since both resolve to '/'. Renaming to 'admin' creates
routes at /admin/* which don't conflict.

Co-Authored-By: john@hyprnote.com <john@hyprnote.com>
@ComputelessComputer ComputelessComputer merged commit c89758b into main Jan 11, 2026
19 checks passed
@ComputelessComputer ComputelessComputer deleted the devin/1768030596-remove-decap-admin-auth branch January 11, 2026 14:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments