Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 10 additions & 16 deletions bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions next.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,20 @@
import type { NextConfig } from "next";

const nextConfig: NextConfig = {
headers: async () => {
return [
{
source: "/oauth-consent",
headers: [
{
key: "Content-Security-Policy",
value: "frame-ancestors 'none'",
},
{ key: "X-Frame-Options", value: "DENY" },
],
},
];
},
redirects: async () => {
return [
{
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
},
"dependencies": {
"@clerk/mcp-tools": "^0.1.1",
"@clerk/nextjs": "^6.39.2",
"@clerk/nextjs": "^7.7.1",
"@clerk/themes": "^2.4.19",
"@mcp-ui/server": "^5.10.0",
"@modelcontextprotocol/sdk": "1.26.0",
Expand Down
8 changes: 4 additions & 4 deletions src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,11 @@ export default function RootLayout({
appearance={{
variables: {
colorPrimary: '#81b300',
colorText: '#1c2024',
colorTextSecondary: '#60646c',
colorForeground: '#1c2024',
colorMutedForeground: '#60646c',
colorBackground: '#f2f0e7',
colorInputBackground: '#f2f0e7',
colorInputText: '#1c2024',
colorInput: '#f2f0e7',
colorInputForeground: '#1c2024',
fontFamily: 'var(--font-inter), Inter, sans-serif',
borderRadius: '0px',
},
Expand Down
35 changes: 35 additions & 0 deletions src/app/oauth-consent/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import { OAuthConsent, RedirectToSignIn, Show } from "@clerk/nextjs";
import type { Metadata } from "next";
import { Col } from "@/components/col";
import { KernelWordmark } from "@/components/icons";

export const metadata: Metadata = {
title: "authorize access | Kernel",
referrer: "strict-origin-when-cross-origin",
};

export default function OAuthConsentPage(): React.ReactElement {
return (
<Show when="signed-in" fallback={<RedirectToSignIn />}>
<Col className="min-h-screen items-center justify-center p-8">
<Col className="w-full max-w-md items-center gap-8">
<KernelWordmark className="text-foreground" width={100} height={22} />
<OAuthConsent
appearance={{
elements: {
rootBox: "w-full",
cardBox: "w-full",
card: "w-full",
},
}}
fallback={
<p className="text-sm text-muted-foreground">
loading authorization...
</p>
}
/>
</Col>
</Col>
</Show>
);
}
18 changes: 11 additions & 7 deletions src/app/select-org/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import {
CreateOrganization,
UserButton,
SignOutButton,
useAuth,
useOrganizationList,
useUser,
Expand Down Expand Up @@ -244,9 +244,11 @@ function SelectOrgContent(): React.ReactElement {
return (
<Col className="min-h-screen items-center justify-center">
<div className="absolute top-6 right-6">
<UserButton
afterSignOutUrl={`/select-org?${searchParams.toString()}`}
/>
<SignOutButton redirectUrl={`/select-org?${searchParams.toString()}`}>
<button className="border-[0.5px] border-foreground px-4 py-2 text-sm cursor-pointer hover:underline">
switch account
</button>
</SignOutButton>
</div>
<Col className="text-center max-w-md mx-auto p-8 gap-8">
<Col className="items-center gap-4">
Expand Down Expand Up @@ -279,9 +281,11 @@ function SelectOrgContent(): React.ReactElement {
return (
<Col className="min-h-screen items-center justify-center">
<div className="absolute top-6 right-6">
<UserButton
afterSignOutUrl={`/select-org?${searchParams.toString()}`}
/>
<SignOutButton redirectUrl={`/select-org?${searchParams.toString()}`}>
<button className="border-[0.5px] border-foreground px-4 py-2 text-sm cursor-pointer hover:underline">
switch account
</button>
</SignOutButton>
</div>

<Col className="max-w-md w-full mx-auto p-8 gap-8">
Expand Down
Loading