Authentication & User Registration Enhancements#31
Open
shreyashsri79 wants to merge 5 commits into
Open
Conversation
…d resolve edit details description validation bug
# Conflicts: # eda-frontend/src/App.js # eda-frontend/src/components/Dashboard/DashboardHome.js # eda-frontend/src/components/SchematicEditor/SchematicToolbar.js # eda-frontend/src/components/Shared/Layout.js # eda-frontend/src/pages/Dashboard.js
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fix: Authentication & User Registration Enhancements + Restored .ENV
Summary
This pull request introduces critical stability fixes for the authentication system, implements a robust pending user registration approval workflow, and adds an administrative dashboard for user account management. It also ensures that local development environments can proceed with registration flows even when SMTP/email services are not configured.
Detailed Changes
1. Stability & Null-Safety (Frontend)
TypeError: can't access property "username", auth.user is null) that occurred on logout or when visiting pages in an unauthenticated state.SchematicsList.jsto accessauth.userproperties via optional chaining (auth.user?.username).DashboardOtherProjects.jswith similar null-safe optional chaining.2. Developer-Friendly OTP Fallback Flow (Frontend & Backend)
EMAIL_HOST_USERandEMAIL_HOST_PASSWORDin.env) are left at default placeholder values, the backend API (CustomUserCreateViewinesim-cloud-backend/authAPI/views.py) will automatically embed the generated activation token directly in the HTTP201 Createdresponse.authActions.jsto detect the presence of this token and display it to the user via a browser alert, allowing registrations to be completed in environments without outgoing mail support.3. Pending User Approval System & DB Schema (Backend)
PendingUserModel: Created a new database model to hold details of users waiting for admin approval before activation.authAPI_pendingusertable.account_dashboard.htmland mapped it to/api/auth/dashboard/to serve as a control panel for administrators to review, approve, and manage user accounts.4. Admin Dashboard Access (Frontend Integration)
Navbar.jsHeader.jsVerification & Testing Steps
Step 1: Run Migrations
Ensure database tables are up to date:
docker exec -it esim-cloud-django-1 python manage.py migrateStep 2: Test User Registration
Step 3: Admin Dashboard Navigation
/api/auth/dashboard/.Step 4: Verify Logout Stability
auth.user.