MrPutzi / design-ai-toolkit

Design + AI Toolkit
https://design-plus-ai-toolkit.vercel.app/
1 stars 0 forks source link

Fix photo generation API response and improve error handling #2

Closed codeautopilot[bot] closed 5 months ago

codeautopilot[bot] commented 5 months ago

Resolves #1

This PR updates the /api/generate endpoint to return a proper JSON response with the generated photo URL. It also enhances the error handling on both the server and client sides to provide better user feedback during the photo generation process.

vercel[bot] commented 5 months ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
design-ai-toolkit ❌ Failed (Inspect) Mar 25, 2024 6:20am
gitguardian[bot] commented 5 months ago

⚠️ GitGuardian has uncovered 2 secrets following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

🔎 Detected hardcoded secrets in your pull request
| GitGuardian id | GitGuardian status | Secret | Commit | Filename | | | -------------- | ------------------ | ------------------------------ | ---------------- | --------------- | -------------------- | | [10086940](https://dashboard.gitguardian.com/incidents/10086940?occurrence=127633358) | Triggered | Replicate user access token | 3626b8b0b2750cbf5890f85f790ed136b0fd7836 | pages/api/generate.ts | [View secret](https://github.com/MrPutzi/design-ai-toolkit/commit/3626b8b0b2750cbf5890f85f790ed136b0fd7836#diff-8ae3f4d93885962d659b1c0b05b36d8b0912dc957d9fc08cf1e4ceb5ba19785eL56) | | [10086940](https://dashboard.gitguardian.com/incidents/10086940?occurrence=127633359) | Triggered | Replicate user access token | 3626b8b0b2750cbf5890f85f790ed136b0fd7836 | pages/api/generate.ts | [View secret](https://github.com/MrPutzi/design-ai-toolkit/commit/3626b8b0b2750cbf5890f85f790ed136b0fd7836#diff-8ae3f4d93885962d659b1c0b05b36d8b0912dc957d9fc08cf1e4ceb5ba19785eL85) |
🛠 Guidelines to remediate hardcoded secrets
1. Understand the implications of revoking this secret by investigating where it is used in your code. 2. Replace and store your secrets safely. [Learn here](https://blog.gitguardian.com/secrets-api-management?utm_source=product&utm_medium=GitHub_checks&utm_campaign=check_run_comment) the best practices. 3. Revoke and [rotate these secrets](https://docs.gitguardian.com/secrets-detection/secrets-detection-engine/detectors/specifics/replicate_user_access_token#revoke-the-secret?utm_source=product&utm_medium=GitHub_checks&utm_campaign=check_run_comment). 4. If possible, [rewrite git history](https://blog.gitguardian.com/rewriting-git-history-cheatsheet?utm_source=product&utm_medium=GitHub_checks&utm_campaign=check_run_comment). Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data. To avoid such incidents in the future consider - following these [best practices](https://blog.gitguardian.com/secrets-api-management/?utm_source=product&utm_medium=GitHub_checks&utm_campaign=check_run_comment) for managing and storing secrets including API keys and other credentials - install [secret detection on pre-commit](https://docs.gitguardian.com/ggshield-docs/integrations/git-hooks/pre-commit?utm_source=product&utm_medium=GitHub_checks&utm_campaign=check_run_comment) to catch secret before it leaves your machine and ease remediation.

🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

Our GitHub checks need improvements? Share your feedbacks!