mirror of
https://github.com/sourcebot-dev/sourcebot.git
synced 2025-12-12 20:35:24 +00:00
add back subscription check in invite redeem page
This commit is contained in:
parent
ea4c29daec
commit
87efbf7d69
1 changed files with 30 additions and 0 deletions
|
|
@ -6,6 +6,8 @@ import { AcceptInviteButton } from "./components/acceptInviteButton"
|
|||
import Image from "next/image";
|
||||
import logoDark from "@/public/sb_logo_dark_large.png";
|
||||
import logoLight from "@/public/sb_logo_light_large.png";
|
||||
import { fetchSubscription } from "@/actions";
|
||||
import { isServiceError } from "@/lib/utils";
|
||||
|
||||
interface RedeemPageProps {
|
||||
searchParams?: {
|
||||
|
|
@ -108,6 +110,34 @@ export default async function RedeemPage({ searchParams }: RedeemPageProps) {
|
|||
)
|
||||
}
|
||||
|
||||
const stripeCustomerId = org.stripeCustomerId;
|
||||
if (stripeCustomerId) {
|
||||
const subscription = await fetchSubscription(org.domain);
|
||||
if (isServiceError(subscription)) {
|
||||
return (
|
||||
<div className="flex flex-col justify-center items-center mt-8 mb-8 md:mt-18 w-full px-5">
|
||||
<div className="max-h-44 w-auto mb-4">
|
||||
<Image
|
||||
src={logoDark}
|
||||
className="h-18 md:h-40 w-auto hidden dark:block"
|
||||
alt={"Sourcebot logo"}
|
||||
priority={true}
|
||||
/>
|
||||
<Image
|
||||
src={logoLight}
|
||||
className="h-18 md:h-40 w-auto block dark:hidden"
|
||||
alt={"Sourcebot logo"}
|
||||
priority={true}
|
||||
/>
|
||||
</div>
|
||||
<div className="flex justify-center items-center">
|
||||
<h1>This organization's subscription has expired. Please renew the subscription and try again.</h1>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="flex flex-col justify-center items-center mt-8 mb-8 md:mt-18 w-full px-5">
|
||||
<div className="max-h-44 w-auto mb-4">
|
||||
|
|
|
|||
Loading…
Reference in a new issue