Deleted the billing-redirect-button, checkout-redirect-button, and embedded-stripe-checkout components. Additionally, removed the shadcn directory, which encompassed billing-related icons. This change streamlines the subscription settings interface and organizes the system's payment management. This update is a stepping stone towards improving the billing system's overall architecture.
22 lines
524 B
TypeScript
22 lines
524 B
TypeScript
import { notFound } from 'next/navigation';
|
|
|
|
import { getSupabaseServerActionClient } from '@kit/supabase/server-actions-client';
|
|
|
|
import isUserSuperAdmin from '~/admin/utils/is-user-super-admin';
|
|
|
|
export function withAdminSession<Args extends unknown[], Response>(
|
|
fn: (...params: Args) => Response,
|
|
) {
|
|
return async (...params: Args) => {
|
|
const isAdmin = await isUserSuperAdmin({
|
|
client: getSupabaseServerActionClient(),
|
|
});
|
|
|
|
if (!isAdmin) {
|
|
notFound();
|
|
}
|
|
|
|
return fn(...params);
|
|
};
|
|
}
|