- Added validation for NEXTAUTH_SECRET to ensure it is set before authentication. - Wrapped the authorization logic in a try-catch block to handle potential errors gracefully and log them for debugging.
- Added validation for NEXTAUTH_SECRET to ensure it is set before authentication. - Wrapped the authorization logic in a try-catch block to handle potential errors gracefully and log them for debugging.