Files
classroomio/packages/db/src/auth/hooks/index.ts
T
Rotimi Best 3919ff6c2f Enhance audience management features with new components and API integrations
- Added `AssignCoursesModal`, `AudienceMemberRow`, `AudienceTable`, and related components for improved audience management UI.
- Implemented audience invite actions including resend and revoke functionality.
- Updated audience API to support importing members and assigning courses.
- Refactored audience data handling to include status and invite management.
- Improved overall user experience with pagination and selection features in the audience table.
2026-03-22 18:42:23 +01:00

28 lines
779 B
TypeScript

import { createAuthMiddleware } from 'better-auth/api';
export type AuthMiddlewareContext = Parameters<Parameters<typeof createAuthMiddleware>[0]>[0];
/**
* Array of all hooks to run after better-auth requests
*
* Add new hooks here to register them
*/
const afterHooks: Array<(context: AuthMiddlewareContext) => Promise<unknown>> = [
// add hooks here
];
/**
* Combines all after hooks into a single function
* This function will be called by better-auth after each request
*/
export const combineAfterHooks = async (context: AuthMiddlewareContext) => {
console.log('[auth] combineAfterHooks: running');
for (const hook of afterHooks) {
try {
await hook(context);
} catch (error) {
console.error('Error executing hook:', error);
}
}
};