Significant-Gravitas / AutoGPT

AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.
https://agpt.co
Other
174.68k stars 45.6k forks source link

fix: backend admin page logic was broken #9616

Closed ntindle closed 1 month ago

ntindle commented 1 month ago

We're building out admin utilities so we need to bring back the /admin route with RBAC. This PR goes through re-enabling that to work with the latest changes

Changes πŸ—οΈ

Checklist πŸ“‹

For code changes:

qodo-merge-pro[bot] commented 1 month ago

PR Reviewer Guide πŸ”

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 2 πŸ”΅πŸ”΅βšͺβšͺβšͺ
πŸ§ͺ No relevant tests
πŸ”’ No security concerns identified
⚑ Recommended focus areas for review

Duplicate Route The '/onboarding' route appears twice in the PROTECTED_PAGES array (lines 8 and 12), which could cause confusion or unexpected behavior in route protection logic. ```typescript "/onboarding", "/profile", "/library", "/monitoring", "/onboarding", ```
Improper Server Action The 'use server' directive is placed after a console.log statement, which is incorrect. It should be at the top of the function to properly mark it as a server action. ```typescript console.log("withRoleAccess called:", allowedRoles); ("use server"); ```
netlify[bot] commented 1 month ago

Deploy Preview for auto-gpt-docs-dev canceled.

Name Link
Latest commit e5a199a94a909644b05a7c41a9818b84b342f9f4
Latest deploy log https://app.netlify.com/sites/auto-gpt-docs-dev/deploys/67d3ab1b4d64190008ff70c2
deepsource-io[bot] commented 1 month ago

Here's the code health analysis summary for commits b9f31a9..e5a199a. View details on DeepSource β†—.

Analysis Summary

AnalyzerStatusSummaryLink
DeepSource JavaScript LogoJavaScriptβœ… Success
❗ 3 occurences introduced
🎯 9 occurences resolved
View Check β†—
DeepSource Python LogoPythonβœ… SuccessView Check β†—

πŸ’‘ If you’re a repository administrator, you can configure the quality gates from the settings.
netlify[bot] commented 1 month ago

Deploy Preview for auto-gpt-docs canceled.

Name Link
Latest commit e5a199a94a909644b05a7c41a9818b84b342f9f4
Latest deploy log https://app.netlify.com/sites/auto-gpt-docs/deploys/67d3ab1b38d4f6000874667c