-
Notifications
You must be signed in to change notification settings - Fork 2
Move root .md files to specs folder #59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
268c4ab
Refactor code structure for improved readability and maintainability
Helal-maker a9cf90f
ci: simplify bun setup by enabling caching for faster installs
Helal-maker afb4917
feat: add initial documentation for BetterBase including NOTICE, READ…
Helal-maker 6e0ecb0
Merge branch 'weroperking:main' into main
Helal-maker 26c7ffd
fix: address code review findings - cleanup API fallbacks, fix WebSoc…
Helal-maker 13a3086
feat: enhance project initialization by prompting for project name an…
Helal-maker 218fc00
feat: implement metrics page and project layout with navigation tabs
Helal-maker File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| const API_BASE = import.meta.env.VITE_API_URL ?? "http://localhost:3001"; | ||
| const API_BASE = import.meta.env.VITE_API_URL; | ||
|
|
||
| export class ApiError extends Error { | ||
| constructor( | ||
|
|
@@ -94,3 +94,12 @@ export const api = { | |
| return res.blob(); | ||
| }, | ||
| }; | ||
|
|
||
| export async function checkSetup(): Promise<boolean> { | ||
| const res = await fetch(`${API_BASE}/admin/auth/setup`, { | ||
| method: "POST", | ||
| headers: { "Content-Type": "application/json" }, | ||
| body: JSON.stringify({ _check: true }), | ||
| }); | ||
| return res.status !== 410; | ||
| } | ||
|
Comment on lines
+98
to
+105
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Handle setup-check statuses explicitly instead of Line 104 currently maps any non-410 response (including 500/404) to Proposed fix export async function checkSetup(): Promise<boolean> {
const res = await fetch(`${API_BASE}/admin/auth/setup`, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ _check: true }),
});
- return res.status !== 410;
+ if (res.status === 410) return false; // setup not required anymore
+ if (res.ok) return true; // setup required
+ throw new ApiError(res.status, "Failed to verify setup status");
}🤖 Prompt for AI Agents |
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Redirect condition is inverted for SetupGuard’s required 410 behavior.
checkSetup()returnsfalseon HTTP 410, but this guard redirects whenisSetupistrue, so redirect currently happens on non-410 responses.Proposed fix
As per coding guidelines, "SetupGuard checks /admin/auth/setup — redirects to /login on 410."
📝 Committable suggestion
🤖 Prompt for AI Agents