fix(web): deprecate app.supermemory.ai / and /login, add clickjacking headers

Redirect the old app entry points (/ , /login, /login/*) to the console
and send CSP frame-ancestors 'none' + X-Frame-Options: DENY on every
response so any remaining HTML surface cannot be framed, matching console.

Co-authored-by: Dhravya Shah <dhravya@supermemory.com>
This commit is contained in:
Cursor Agent 2026-08-31 17:31:41 +00:00
parent 9ccd1b64c3
commit 3694f2b5c6
No known key found for this signature in database

View file

@ -37,8 +37,41 @@ const nextConfig: NextConfig = {
]
},
skipTrailingSlashRedirect: true,
async headers() {
// app.supermemory.ai is being deprecated in favour of the console.
// Anything that still serves HTML must not be framable, matching the
// console's clickjacking protection.
return [
{
source: "/:path*",
headers: [
{ key: "X-Frame-Options", value: "DENY" },
{
key: "Content-Security-Policy",
value: "frame-ancestors 'none'",
},
],
},
]
},
async redirects() {
return [
// The old app surface is dying: send its entry points to the console.
{
source: "/",
destination: "https://console.supermemory.ai",
permanent: false,
},
{
source: "/login",
destination: "https://console.supermemory.ai",
permanent: false,
},
{
source: "/login/:path*",
destination: "https://console.supermemory.ai",
permanent: false,
},
{
source: "/new",
destination: "/",