Unify workspace dropdowns; Update layouts (#458)
Unified Account and Workspace drop-downs; Layout updates, now header lives within the PageBody component; Sidebars now use floating variant
This commit is contained in:
committed by
GitHub
parent
ca585e09be
commit
4bc8448a1d
@@ -0,0 +1,23 @@
|
||||
import 'server-only';
|
||||
|
||||
import { notFound } from 'next/navigation';
|
||||
|
||||
import { authActionClient } from '@kit/next/safe-action';
|
||||
import { getSupabaseServerClient } from '@kit/supabase/server-client';
|
||||
|
||||
import { isSuperAdmin } from './is-super-admin';
|
||||
|
||||
/**
|
||||
* @name adminActionClient
|
||||
* @description Safe action client for admin-only actions.
|
||||
* Extends authActionClient with super admin verification.
|
||||
*/
|
||||
export const adminActionClient = authActionClient.use(async ({ next, ctx }) => {
|
||||
const isAdmin = await isSuperAdmin(getSupabaseServerClient());
|
||||
|
||||
if (!isAdmin) {
|
||||
notFound();
|
||||
}
|
||||
|
||||
return next({ ctx });
|
||||
});
|
||||
Reference in New Issue
Block a user