2026-02-24 18:15:44 +00:00
|
|
|
import * as plugins from '../../plugins.ts';
|
|
|
|
|
import type { AdminHandler } from '../handlers/admin.handler.ts';
|
|
|
|
|
import * as interfaces from '../../../ts_interfaces/index.ts';
|
|
|
|
|
|
|
|
|
|
export async function requireValidIdentity<T extends { identity?: interfaces.data.IIdentity }>(
|
|
|
|
|
adminHandler: AdminHandler,
|
|
|
|
|
dataArg: T,
|
2026-04-19 01:30:54 +00:00
|
|
|
): Promise<interfaces.data.IIdentity> {
|
|
|
|
|
return await adminHandler.getVerifiedIdentity(dataArg.identity);
|
2026-02-24 18:15:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export async function requireAdminIdentity<T extends { identity?: interfaces.data.IIdentity }>(
|
|
|
|
|
adminHandler: AdminHandler,
|
|
|
|
|
dataArg: T,
|
2026-04-19 01:30:54 +00:00
|
|
|
): Promise<interfaces.data.IIdentity> {
|
|
|
|
|
return await adminHandler.getVerifiedAdminIdentity(dataArg.identity);
|
2026-02-24 18:15:44 +00:00
|
|
|
}
|