Skip to content

Commit

Permalink
only allow me for now
Browse files Browse the repository at this point in the history
  • Loading branch information
aabassiouni committed Jun 1, 2024
1 parent dc47851 commit 5226b8c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { SignIn } from "@clerk/nextjs";

export default function Page() {
return process.env.NODE_ENV === "development" ? <SignIn /> : null;
return <SignIn />;
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { SignUp } from "@clerk/nextjs";

export default function Page() {
return process.env.NODE_ENV === "development" ? <SignUp /> : null;
return <SignUp />;
}
5 changes: 5 additions & 0 deletions apps/web/src/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ export default async function middleware(request: NextRequest, evt: NextFetchEve
}
const workspace = await getWorkspaceForTenant(auth.userId!);

// only allow me
if (auth.userId !== process.env.USER_ID) {
return NextResponse.redirect(new URL("/", req.url));
}

// create a workspace if there isn't one
if (!workspace && auth.userId && request.nextUrl.pathname !== "/dashboard/setup") {
console.log("no workspace found, creating one");
Expand Down

0 comments on commit 5226b8c

Please sign in to comment.