Open
Conversation
FinnK04
reviewed
Nov 28, 2025
Collaborator
FinnK04
left a comment
There was a problem hiding this comment.
In the backend, create a new folder containing all backend files so that they correspond to the new planned structure.
…eset, explicit user field selection, and configurable initial admin password.
FinnK04
approved these changes
Nov 29, 2025
Collaborator
FinnK04
left a comment
There was a problem hiding this comment.
Please add the changes you made to your .env file to the .env.example file.
Then rebase your changes, squash them, and give them a meaningful name :)
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.
This pull request introduces a comprehensive set of changes to support admin functionality in the backend. It adds an
is_adminfield to theUsermodel, implements admin-only API endpoints for user management, and enforces admin access via middleware. The changes include new handlers for admin operations, route setup, and logic to seed an initial admin user.Admin API and Access Control:
AdminHandlerinbackend/handlers/admin.gowith endpoints for dashboard stats, user listing/search, user promotion to admin, user deletion, verification, update, and password reset. All endpoints require admin authentication and password confirmation for sensitive actions.AdminMiddlewareinbackend/middleware/auth.goto restrict access to admin routes, ensuring only authenticated admin users can access these endpoints.backend/main.gounder/v1/admin, applying both authentication and admin middleware. [1] [2]User Model and API Enhancements:
IsAdminboolean field to theUsermodel inbackend/models/models.go, and exposed it in the user API responses. [1] [2] [3]Admin User Initialization:
seedAdminfunction inbackend/main.goto create or update an initial admin user (nora.admin@nordakademie.de) with a default password and admin privileges.Other Improvements:
backend/main.goto support new functionality (e.g.,uuid,utils,models). [1] [2]These changes collectively provide a secure and robust foundation for admin operations in the application.