-
Notifications
You must be signed in to change notification settings - Fork 890
feat: add Clerk auth to marketing site and improve web app UI #340
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
82af3e5
5808dee
06c8b09
53098e9
5e993b4
0d69916
6653f4a
1e3b2f1
f717f9b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,10 +12,8 @@ import { | |
| SidebarProvider, | ||
| SidebarTrigger, | ||
| } from "@superset/ui/sidebar"; | ||
| import { redirect } from "next/navigation"; | ||
|
|
||
| import { env } from "@/env"; | ||
| import { currentUser } from "@/lib/auth/server"; | ||
| import { api } from "@/trpc/server"; | ||
|
|
||
| import { AppSidebar } from "./components/AppSidebar"; | ||
|
|
||
|
|
@@ -24,11 +22,11 @@ export default async function DashboardLayout({ | |
| }: { | ||
| children: React.ReactNode; | ||
| }) { | ||
| const user = await currentUser(); | ||
| const trpc = await api(); | ||
| const user = await trpc.user.me.query(); | ||
|
|
||
| // Redirect unauthorized users to web app | ||
| if (!user) { | ||
| redirect(env.NEXT_PUBLIC_WEB_URL); | ||
| throw new Error("User not found"); | ||
| } | ||
|
Comment on lines
+25
to
30
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Avoid a generic throw here; redirect (or render an auth state) instead of 500. 🤖 Prompt for AI Agents |
||
|
|
||
| return ( | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use separate Clerk environment for preview deployments.
Preview deployments are currently using the same Clerk secrets as production (
CLERK_SECRET_KEY,CLERK_WEBHOOK_SECRET, etc.). This creates several operational and security risks:NEXT_PUBLIC_COOKIE_DOMAINmay cause conflicts between preview and production environmentsRecommendation: Create a separate Clerk project for preview/development environments and configure separate secrets (e.g.,
CLERK_SECRET_KEY_PREVIEW,CLERK_WEBHOOK_SECRET_PREVIEW, etc.).Also applies to: 195-197, 252-254, 323-325
🤖 Prompt for AI Agents