Skip to content

Open-source status page, incident response and uptime monitoring

🚀 (#294)

Thibault Le Ouay6d9e9add1caf
diff --git a/apps/api/README.md b/apps/api/README.md
index f4da3c4c1..fc5639826 100644
--- a/apps/api/README.md
+++ b/apps/api/README.md
@@ -1,4 +1,5 @@
-This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).
+This is a [Next.js](https://nextjs.org/) project bootstrapped with
+[`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).
## Getting Started
@@ -12,23 +13,34 @@ yarn dev
pnpm dev
```
-Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
+Open [http://localhost:3000](http://localhost:3000) with your browser to see the
+result.
-You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file.
+You can start editing the page by modifying `app/page.tsx`. The page
+auto-updates as you edit the file.
-This project uses [`next/font`](https://nextjs.org/docs/basic-features/font-optimization) to automatically optimize and load Inter, a custom Google Font.
+This project uses
+[`next/font`](https://nextjs.org/docs/basic-features/font-optimization) to
+automatically optimize and load Inter, a custom Google Font.
## Learn More
To learn more about Next.js, take a look at the following resources:
-- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
+- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js
+ features and API.
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
-You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!
+You can check out
+[the Next.js GitHub repository](https://github.com/vercel/next.js/) - your
+feedback and contributions are welcome!
## Deploy on Vercel
-The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.
+The easiest way to deploy your Next.js app is to use the
+[Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme)
+from the creators of Next.js.
-Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.
+Check out our
+[Next.js deployment documentation](https://nextjs.org/docs/deployment) for more
+details.
diff --git a/apps/api/src/app/layout.tsx b/apps/api/src/app/layout.tsx
index a14e64fcd..5ff842ef0 100644
--- a/apps/api/src/app/layout.tsx
+++ b/apps/api/src/app/layout.tsx
@@ -1,16 +1,16 @@
export const metadata = {
- title: 'Next.js',
- description: 'Generated by Next.js',
-}
+ title: "Next.js",
+ description: "Generated by Next.js",
+};
export default function RootLayout({
children,
}: {
- children: React.ReactNode
+ children: React.ReactNode;
}) {
return (
<html lang="en">
<body>{children}</body>
</html>
- )
+ );
}
diff --git a/apps/web/src/middleware.ts b/apps/web/src/middleware.ts
index c56a69541..675e1e954 100644
--- a/apps/web/src/middleware.ts
+++ b/apps/web/src/middleware.ts
@@ -84,6 +84,7 @@ export default authMiddleware({
auth.userId &&
(req.nextUrl.pathname === "/app" || req.nextUrl.pathname === "/app/")
) {
+ console.log('>>> Redirecting to "/app/workspace"');
// improve on sign-up if the webhook has not been triggered yet
const userQuery = db
.select()
@@ -96,6 +97,7 @@ export default authMiddleware({
.innerJoin(userQuery, eq(userQuery.id, usersToWorkspaces.userId))
.all();
if (result.length > 0) {
+ console.log(">>> User has workspace");
const currentWorkspace = await db
.select()
.from(workspace)
@@ -106,6 +108,7 @@ export default authMiddleware({
`/app/${currentWorkspace.slug}/monitors`,
req.url,
);
+ console.log(`>>> Redirecting to ${orgSelection}`);
return NextResponse.redirect(orgSelection);
}
} else {