-
-
Save MonteLogic/e60c6037b56045bdfc3ad5548ecdc39d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { NextRequest, NextResponse } from 'next/server'; | |
import { clerkClient, currentUser, auth } from "@clerk/nextjs"; | |
export async function GET(req: NextRequest, res: NextResponse) { | |
const { userId, orgId } = auth(); | |
const currentUser_ = await currentUser(); | |
const user = userId ? await clerkClient.users.getUser(userId) : null; | |
// console.log({ userId, currentUser_, user }); | |
// console.log(15, user?.privateMetadata); | |
console.log(14, orgId); | |
if (req.method !== "GET") { | |
return NextResponse.json({ message: "Method not allowed" }); | |
} | |
try { | |
return NextResponse.json(orgId); | |
} catch (err) { | |
console.error(err); | |
return NextResponse.json({ message: "Something went wrong" }); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment