Skip to content
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

Upgrade to v5 #11

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
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
14 changes: 0 additions & 14 deletions .env.example

This file was deleted.

5 changes: 4 additions & 1 deletion app/(demo)/create-organization/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ export default function CreateOrganizationPage() {
<div className={"flex w-full flex-col"}>
<h1>UI Component</h1>
<ClerkLoading>Loading ...</ClerkLoading>
<CreateOrganization skipInvitationScreen={true} />
<CreateOrganization
path="/create-organization"
skipInvitationScreen={true}
/>
<h1 className="mb-4 mt-20">Custom UI </h1>
<CustomCreateOrganizationForm />
<h2 className="mb-4 mt-8">List your memberships</h2>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export default function OrganizationPage() {
<div className={"flex flex-col pb-12"}>
<h1 className="mb-6 mt-12">UI Component</h1>
<ClerkLoading>Loading ...</ClerkLoading>
<OrganizationProfile />
<OrganizationProfile path="/organization-profile" />
<h1 className="mb-6 mt-12">Custom List Domains</h1>
<OrgVerifiedDomains />
<h1 className="mb-6 mt-12">Custom List Invitations</h1>
Expand Down
2 changes: 1 addition & 1 deletion app/(demo)/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export default function DashboardPage() {
</li>
<li>
<Link
href="/organization"
href="/organization-profile"
className="block rounded border p-5 text-center text-lg font-medium shadow"
>
Organization Profile
Expand Down
3 changes: 2 additions & 1 deletion app/authorization-playground/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { PropsWithChildren } from "react"
import { auth, OrganizationList } from "@clerk/nextjs"
import { OrganizationList } from "@clerk/nextjs"
import { auth } from "@clerk/nextjs/server"
import Link from "next/link"

export default function AuthorizationPlaygroundLayout(
Expand Down
4 changes: 3 additions & 1 deletion app/authorization-playground/settings/page.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { ClerkLoading, OrganizationProfile, auth } from "@clerk/nextjs"
import { ClerkLoading, OrganizationProfile } from "@clerk/nextjs"
import { auth } from "@clerk/nextjs/server"

export default function CustomAppSettings() {
auth().protect({
Expand All @@ -15,6 +16,7 @@ export default function CustomAppSettings() {
<h2>Clerk Organization Settings</h2>
<ClerkLoading>Loading ...</ClerkLoading>
<OrganizationProfile
path="/authorization-playground/settings"
appearance={{
elements: {
rootBox: "w-full",
Expand Down
52 changes: 28 additions & 24 deletions components/OrganizationList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,30 +20,34 @@ export const MyMemberships = () => {
return (
<>
<ul>
{userMemberships.data?.map((mem) => (
<li key={mem.id} className="flex w-full justify-between">
<span>{mem.organization.name}</span>
<div>
<button
onClick={() => setActive({ organization: mem.organization.id })}
>
Select
</button>
<button
onClick={() =>
setActive({
organization: mem.organization.id,
beforeEmit: () => {
push("/organization")
},
})
}
>
Redirect
</button>
</div>
</li>
))}
{userMemberships.data?.map((mem) => {
return (
<li key={mem?.id} className="flex w-full justify-between">
<span>{mem?.organization.name}</span>
<div>
<button
onClick={() =>
setActive({ organization: mem?.organization.id })
}
>
Select
</button>
<button
onClick={() =>
setActive({
organization: mem?.organization.id,
beforeEmit: () => {
push("/organization")
},
})
}
>
Redirect
</button>
</div>
</li>
)
})}
</ul>

<button
Expand Down
3 changes: 2 additions & 1 deletion components/RequireActiveOrganization.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { auth, OrganizationList } from "@clerk/nextjs"
import { OrganizationList } from "@clerk/nextjs"
import { auth } from "@clerk/nextjs/server"
import { PropsWithChildren } from "react"

export const RequireActiveOrganization = (props: PropsWithChildren) => {
Expand Down
Loading