Overview
Theauto-deactivate edge function automatically deactivates check-in pages and attendee portals for events that have ended. This function is designed to be triggered by super admins to maintain system hygiene and security.
Endpoint
Authentication
Requires a valid Bearer token withsuper_admin role.
Deactivation Logic
The function performs two types of deactivation:- Check-in Pages: Deactivated for events that ended more than 1 day ago
- Attendee Portals: Deactivated for events that ended more than 3 days ago
Request
No request body is required. The function automatically processes all eligible events.Example Request
Response
Success Response (200 OK)
Number of check-in pages that were deactivated
Number of attendee portals that were deactivated
ISO 8601 timestamp of when the operation completed
Error Responses
401 Unauthorized
Returned when the Bearer token is missing or invalid.403 Forbidden
Returned when the authenticated user does not havesuper_admin role.
500 Internal Server Error
Returned when the deactivation process fails.Implementation Details
Check-in Page Deactivation
From source/supabase/functions/auto-deactivate/index.ts:60-69:Attendee Portal Deactivation
From source/supabase/functions/auto-deactivate/index.ts:72-92:Use Cases
- Scheduled Cleanup: Run via cron job to automatically clean up expired events
- Manual Trigger: Super admin can manually trigger cleanup as needed
- Security: Prevents access to check-in pages and attendee portals after events conclude
- Data Hygiene: Maintains clean system state by deactivating old event resources