1
0
Fork 0
mirror of https://github.com/maziggy/bambuddy.git synced 2026-05-09 08:25:54 +02:00

[PR #128] [MERGED] Fixed re-auth setup and gitignore node modules #941

Closed
opened 2026-05-07 00:15:05 +02:00 by BreizhHardware · 0 comments

📋 Pull Request Information

Original PR: https://github.com/maziggy/bambuddy/pull/128
Author: @JesseFPV
Created: 1/22/2026
Status: Merged
Merged: 1/22/2026
Merged by: @maziggy

Base: 0.1.6b11Head: 0.1.6b11


📝 Commits (1)

  • 3a84864 Fixed re-auth setup and gitignore node modules

📊 Changes

8 files changed (+591 additions, -499 deletions)

View changed files

📝 .gitignore (+3 -0)
📝 backend/app/api/routes/auth.py (+72 -36)
📝 frontend/src/App.tsx (+3 -0)
📝 frontend/src/contexts/AuthContext.tsx (+24 -5)
📝 frontend/src/pages/SettingsPage.tsx (+5 -1)
📝 frontend/src/pages/SetupPage.tsx (+64 -37)
📝 static/assets/index-7nHE42SH.js (+419 -419)
📝 static/index.html (+1 -1)

📄 Description

Description

This PR fixes authentication setup issues, particularly around re-enabling authentication and preventing redirect loops. It also adds node_modules/ to .gitignore to prevent accidentally committing Node.js dependencies.

Fixes #

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Code refactoring
  • Performance improvement
  • Test addition or update

Changes Made

  • Added setup_completed status tracking to prevent infinite redirect loops when setup was already completed
  • Fixed authentication setup flow to allow re-enabling auth without requiring new admin user creation if admin users already exist
  • Improved redirect logic in AuthContext to prevent redirect loops and handle setup completion state properly
  • Added proper handling for when users navigate to /setup after authentication was already enabled
  • Added node_modules/ to .gitignore to prevent committing Node.js dependencies
  • Updated SetupPage to refresh auth status after setup completion and handle cases where admin users already exist
  • Fixed button type in SettingsPage to prevent form submission when navigating to setup page

Screenshots

Testing

  • I have tested this on my local machine
  • I have tested with my printer model:

Test scenarios:

  • Initial setup with authentication enabled (creates admin user)
  • Initial setup with authentication disabled
  • Re-enabling authentication when admin users already exist (should not require new admin creation)
  • Navigating to /setup after authentication is already enabled (should redirect to login)
  • Verifying no redirect loops occur when setup is completed

Checklist

  • My code follows the project's coding style
  • I have commented my code where necessary
  • I have updated the documentation (if needed)
  • My changes generate no new warnings
  • I have tested my changes thoroughly

Additional Notes

  • The setup_completed flag is now tracked in the database to distinguish between "auth not enabled" and "setup not completed yet"
  • This allows users to skip authentication during initial setup and enable it later without being forced into a redirect loop
  • The setup endpoint now intelligently checks if admin users exist before requiring admin credentials, making it easier to re-enable authentication

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/maziggy/bambuddy/pull/128 **Author:** [@JesseFPV](https://github.com/JesseFPV) **Created:** 1/22/2026 **Status:** ✅ Merged **Merged:** 1/22/2026 **Merged by:** [@maziggy](https://github.com/maziggy) **Base:** `0.1.6b11` ← **Head:** `0.1.6b11` --- ### 📝 Commits (1) - [`3a84864`](https://github.com/maziggy/bambuddy/commit/3a848643c0c7df585bed1e5ed792d5da4ab87939) Fixed re-auth setup and gitignore node modules ### 📊 Changes **8 files changed** (+591 additions, -499 deletions) <details> <summary>View changed files</summary> 📝 `.gitignore` (+3 -0) 📝 `backend/app/api/routes/auth.py` (+72 -36) 📝 `frontend/src/App.tsx` (+3 -0) 📝 `frontend/src/contexts/AuthContext.tsx` (+24 -5) 📝 `frontend/src/pages/SettingsPage.tsx` (+5 -1) 📝 `frontend/src/pages/SetupPage.tsx` (+64 -37) 📝 `static/assets/index-7nHE42SH.js` (+419 -419) 📝 `static/index.html` (+1 -1) </details> ### 📄 Description ## Description This PR fixes authentication setup issues, particularly around re-enabling authentication and preventing redirect loops. It also adds `node_modules/` to `.gitignore` to prevent accidentally committing Node.js dependencies. ## Related Issue <!-- Link to the issue this PR addresses (if applicable) --> Fixes # ## Type of Change <!-- Mark the relevant option with an "x" --> - [X] Bug fix (non-breaking change that fixes an issue) - [ ] New feature (non-breaking change that adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to change) - [ ] Documentation update - [ ] Code refactoring - [ ] Performance improvement - [ ] Test addition or update ## Changes Made <!-- List the specific changes made in this PR --> - Added `setup_completed` status tracking to prevent infinite redirect loops when setup was already completed - Fixed authentication setup flow to allow re-enabling auth without requiring new admin user creation if admin users already exist - Improved redirect logic in `AuthContext` to prevent redirect loops and handle setup completion state properly - Added proper handling for when users navigate to `/setup` after authentication was already enabled - Added `node_modules/` to `.gitignore` to prevent committing Node.js dependencies - Updated `SetupPage` to refresh auth status after setup completion and handle cases where admin users already exist - Fixed button type in SettingsPage to prevent form submission when navigating to setup page ## Screenshots <!-- If applicable, add screenshots to demonstrate your changes --> ## Testing <!-- Describe how you tested your changes --> - [X] I have tested this on my local machine - [ ] I have tested with my printer model: <!-- e.g., X1C, P1S, A1 --> **Test scenarios:** - Initial setup with authentication enabled (creates admin user) - Initial setup with authentication disabled - Re-enabling authentication when admin users already exist (should not require new admin creation) - Navigating to `/setup` after authentication is already enabled (should redirect to login) - Verifying no redirect loops occur when setup is completed ## Checklist - [X] My code follows the project's coding style - [X] I have commented my code where necessary - [ ] I have updated the documentation (if needed) - [X] My changes generate no new warnings - [X] I have tested my changes thoroughly ## Additional Notes <!-- Add any additional information that reviewers should know --> - The `setup_completed` flag is now tracked in the database to distinguish between "auth not enabled" and "setup not completed yet" - This allows users to skip authentication during initial setup and enable it later without being forced into a redirect loop - The setup endpoint now intelligently checks if admin users exist before requiring admin credentials, making it easier to re-enable authentication --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
BreizhHardware 2026-05-07 00:15:05 +02:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/bambuddy-maziggy-1#941
No description provided.