By creating this pull request, I grant the project maintainers an unlimited,
perpetual license to use, modify, and redistribute these contributions under any terms they
choose, including both the AGPLv3 and the Fossorial Commercial license terms. I
represent that I have the right to grant this license for all contributed content.
Description
Problem/Motivation:
Orgs currently lack the flexibility to reset passwords for internal users. Additionally, improving user management by making "Name" a more prominent field and defaulting to a more intuitive tab for user details will enhance usability.
Solution/Approach:
This pull request introduces a comprehensive set of changes to address user management for password reset and basic user details. I've added a dedicated "Security" tab within settings menu, allowing administrators to define the password reset token's validity period. This is implemented with a new API endpoint, updated backend logic for password resets, and corresponding frontend changes. I've also refined the user creation and management flows to incorporate the user's name more effectively and adjusted the default user details view for better UX.
Key Features & Changes:
Configurable Password Reset Token Expiration:
A new "Security" tab has been added to organization settings, accessible alongside the "General" tab.
Organizations can now set password reset token expiration from 1 to 24 hours (default: 1 hour).
This setting is applied globally for all password resets within that organization.
New API Endpoint for Security Settings:
Implemented updateOrgSecurity (PUT /org/{orgId}/security) for securely updating organization security parameters. This endpoint is protected with proper admin authorization.
Enhanced Password Reset Functionality:
The password reset process now dynamically uses the organization-specific expiry setting retrieved from the database.
User Details and Account Creation Enhancements:
Added a "Name" field to user details, visible in user management and prompted during user account creation.
The default tab when viewing user details has been changed from "Access Controls" to "Details" for improved navigation.
Technical Details:
Backend Changes:
server/routers/org/updateOrgSecurity.ts: Defines the new API endpoint responsible for handling updates to organization security settings, including the passwordResetTokenExpiryHours.
server/routers/external.ts: Adds the PUT /org/{orgId}/security route, making the new endpoint accessible.
server/routers/user/adminResetUserPassword.ts: Modified to fetch and use the passwordResetTokenExpiryHours from the organization's settings when generating a password reset token.
Frontend Changes:
src/app/[orgId]/settings/general/layout.tsx: Updated to include navigation to the new "Security" tab within the organization settings layout.
src/app/[orgId]/settings/general/security/page.tsx: Contains the React component for the security settings form, allowing administrators to configure the token expiration.
src/app/[orgId]/settings/access/users/[userId]/page.tsx: Modified the default page to "Details" tab when viewing individual user profiles.
Database Integration:
A new column, passwordResetTokenExpiryHours, has been added to the orgs table.
This column is designed with backward compatibility in mind, ensuring existing organizations default to a 1-hour expiration.
Observe the "Password Reset Token Expiration" field, defaulting to 1 hour.
Change the value to 12 hours and click Save.
Verify that a success message is displayed.
(Optional, for backend verification): If you have access to the database, check the orgs table for the corresponding organization and confirm passwordResetTokenExpiryHours is set to 12.
As the same administrator, go to Access Controls -> Users.
Select a user and initiate a Password Reset.
Use the password reset link that was sent to the user (e.g., via email or a temporary display) and successfully create a new password.
Repeat steps 5-10 with a different value (e.g., 1 hour, 24 hours) to ensure the range works. Also, test entering an invalid value (e.g., 0, 25, text) and confirm appropriate validation errors.
Scenario 2: User Name and Default Tab
Log in as an organization administrator.
Navigate to Access Controls -> Users.
Click Add User.
Fill in the user details, ensuring the Name field is present and you can input a value. Complete the user creation.
After the user is created, click on the newly created user's entry in the list.
Confirm that when the user's details page loads, the Details tab is selected by default (not "Access Controls").
Verify that the "Name" you entered during creation is correctly displayed.
Screenshots
If you have SMTP set up, an email with the password reset link will be sent to the user.
If no SMTP is set up, you can generate the link directly within the UI.
User Account Password Reset Screen.
Password Reset Option No SMTP
Password Reset Option With SMTP & Email UI
User Password Reset UI Dialog (After getting the URL)
Two-factor authentication prompt when resetting password via generated link
🔄 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/fosrl/pangolin/pull/975
**Author:** [@adrianeastles](https://github.com/adrianeastles)
**Created:** 6/27/2025
**Status:** ❌ Closed
**Base:** `dev` ← **Head:** `enhancement/admin-user-management-user-details`
---
### 📝 Commits (10+)
- [`b1d4b6c`](https://github.com/fosrl/pangolin/commit/b1d4b6ca4876c012d91fd6f9dced1b5c0d278ebf) New translations en-us.json (Polish)
- [`a4f86f3`](https://github.com/fosrl/pangolin/commit/a4f86f37ff982826cae85897bf350d31c811241f) New translations en-us.json (Portuguese)
- [`3fe4955`](https://github.com/fosrl/pangolin/commit/3fe4955cf06b1292e14860d0183bfee89e7458de) Merge pull request #12 from Lokowitz/translations_i18n
- [`c94e5fc`](https://github.com/fosrl/pangolin/commit/c94e5fcbd5896e07220dfcc81340d19785002de1) ...
- [`7f40846`](https://github.com/fosrl/pangolin/commit/7f40846ad6b05914dd481c64ecc4874cabf8273b) api keys
- [`5d66e08`](https://github.com/fosrl/pangolin/commit/5d66e08dfeebcbc88c06e8ab46fbdd4719dd0a86) Merge pull request #14 from vlalx/support_i18n
- [`9f08b03`](https://github.com/fosrl/pangolin/commit/9f08b03b5c1c92de37d0c67f01735c1c175bac55) add admin/user i18n
- [`18f6fcd`](https://github.com/fosrl/pangolin/commit/18f6fcd63d1eb0ed8e0095d9c93c6f0165a6928c) add admin/license i18n
- [`2d0cbd0`](https://github.com/fosrl/pangolin/commit/2d0cbd0bea196361965baca3149da4d2247e2a19) New translations en-us.json (French)
- [`291cae0`](https://github.com/fosrl/pangolin/commit/291cae03695fe0f402fee1cd0a672e4c247b1200) New translations en-us.json (German)
### 📊 Changes
**1 file changed** (+1 additions, -1 deletions)
<details>
<summary>View changed files</summary>
📝 `src/app/auth/reset-password/ResetPasswordForm.tsx` (+1 -1)
</details>
### 📄 Description
## Community Contribution License Agreement
By creating this pull request, I grant the project maintainers an unlimited,
perpetual license to use, modify, and redistribute these contributions under any terms they
choose, including both the AGPLv3 and the Fossorial Commercial license terms. I
represent that I have the right to grant this license for all contributed content.
## Description
**Problem/Motivation:**
Orgs currently lack the flexibility to reset passwords for internal users. Additionally, improving user management by making "Name" a more prominent field and defaulting to a more intuitive tab for user details will enhance usability.
**Solution/Approach:**
This pull request introduces a comprehensive set of changes to address user management for password reset and basic user details. I've added a dedicated "Security" tab within settings menu, allowing administrators to define the password reset token's validity period. This is implemented with a new API endpoint, updated backend logic for password resets, and corresponding frontend changes. I've also refined the user creation and management flows to incorporate the user's name more effectively and adjusted the default user details view for better UX.
**Key Features & Changes:**
* **Configurable Password Reset Token Expiration:**
* A new "Security" tab has been added to organization settings, accessible alongside the "General" tab.
* Organizations can now set password reset token expiration from 1 to 24 hours (default: 1 hour).
* This setting is applied globally for all password resets within that organization.
* **New API Endpoint for Security Settings:**
* Implemented `updateOrgSecurity` (PUT `/org/{orgId}/security`) for securely updating organization security parameters. This endpoint is protected with proper admin authorization.
* **Enhanced Password Reset Functionality:**
* The password reset process now dynamically uses the organization-specific expiry setting retrieved from the database.
* **User Details and Account Creation Enhancements:**
* Added a "Name" field to user details, visible in user management and prompted during user account creation.
* The default tab when viewing user details has been changed from "Access Controls" to "Details" for improved navigation.
**Technical Details:**
**Backend Changes:**
- `server/routers/org/updateOrgSecurity.ts`: Defines the new API endpoint responsible for handling updates to organization security settings, including the `passwordResetTokenExpiryHours`.
- `server/routers/external.ts`: Adds the `PUT /org/{orgId}/security` route, making the new endpoint accessible.
- `server/routers/user/adminResetUserPassword.ts`: Modified to fetch and use the `passwordResetTokenExpiryHours` from the organization's settings when generating a password reset token.
**Frontend Changes:**
- `src/app/[orgId]/settings/general/layout.tsx`: Updated to include navigation to the new "Security" tab within the organization settings layout.
- `src/app/[orgId]/settings/general/security/page.tsx`: Contains the React component for the security settings form, allowing administrators to configure the token expiration.
- `src/app/[orgId]/settings/access/users/[userId]/page.tsx`: Modified the default page to "Details" tab when viewing individual user profiles.
**Database Integration:**
- A new column, `passwordResetTokenExpiryHours`, has been added to the `orgs` table.
- This column is designed with backward compatibility in mind, ensuring existing organizations default to a 1-hour expiration.
## How to test?
**Scenario 1: Configure Password Reset Token Expiration**
1. Log in as an organization administrator.
2. Navigate to **Organization Settings**.
3. Click on the newly added **Security** tab.
4. Observe the "Password Reset Token Expiration" field, defaulting to 1 hour.
5. Change the value to **12 hours** and click **Save**.
6. Verify that a success message is displayed.
7. (Optional, for backend verification): If you have access to the database, check the `orgs` table for the corresponding organization and confirm `passwordResetTokenExpiryHours` is set to 12.
8. As the same administrator, go to **Access Controls** -> **Users**.
9. Select a user and initiate a **Password Reset**.
10. **Use the password reset link that was sent to the user (e.g., via email or a temporary display) and successfully create a new password.**
11. Repeat steps 5-10 with a different value (e.g., 1 hour, 24 hours) to ensure the range works. Also, test entering an invalid value (e.g., 0, 25, text) and confirm appropriate validation errors.
**Scenario 2: User Name and Default Tab**
1. Log in as an organization administrator.
2. Navigate to **Access Controls** -> **Users**.
3. Click **Add User**.
4. Fill in the user details, ensuring the **Name** field is present and you can input a value. Complete the user creation.
5. After the user is created, click on the newly created user's entry in the list.
6. Confirm that when the user's details page loads, the **Details** tab is selected by default (not "Access Controls").
7. Verify that the "Name" you entered during creation is correctly displayed.
### Screenshots
* If you have SMTP set up, an email with the password reset link will be sent to the user.
* If no SMTP is set up, you can generate the link directly within the UI.
# User Account Password Reset Screen.
<img width="1785" alt="Screenshot 2025-06-27 at 7 48 39 am" src="https://github.com/user-attachments/assets/935c06c7-1c1c-4740-9bff-8e07673cbdee" />
# Password Reset Option No SMTP
<img width="1508" alt="Screenshot 2025-06-27 at 7 57 52 am" src="https://github.com/user-attachments/assets/aaa1c0dd-bac0-468a-a7dd-3ec4f5f7ecac" />
# Password Reset Option With SMTP & Email UI
<img width="1521" alt="Screenshot 2025-06-27 at 8 16 20 am" src="https://github.com/user-attachments/assets/c06888b2-6640-47b3-ae7c-560b4eb10293" />
<img width="542" alt="Screenshot 2025-06-27 at 8 18 22 am" src="https://github.com/user-attachments/assets/c1bf1388-662d-4178-b9c5-f36850d3bcfe" />
# User Password Reset UI Dialog (After getting the URL)
<img width="538" alt="Screenshot 2025-06-27 at 7 58 21 am" src="https://github.com/user-attachments/assets/d1161e39-4533-4e06-97ed-569f327f4382" />
# Two-factor authentication prompt when resetting password via generated link
<img width="495" alt="Screenshot 2025-06-27 at 9 04 41 am" src="https://github.com/user-attachments/assets/ff4825fe-faba-405a-bd2a-11d59f4e08cc" />
---
<sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
📋 Pull Request Information
Original PR: https://github.com/fosrl/pangolin/pull/975
Author: @adrianeastles
Created: 6/27/2025
Status: ❌ Closed
Base:
dev← Head:enhancement/admin-user-management-user-details📝 Commits (10+)
b1d4b6cNew translations en-us.json (Polish)a4f86f3New translations en-us.json (Portuguese)3fe4955Merge pull request #12 from Lokowitz/translations_i18nc94e5fc...7f40846api keys5d66e08Merge pull request #14 from vlalx/support_i18n9f08b03add admin/user i18n18f6fcdadd admin/license i18n2d0cbd0New translations en-us.json (French)291cae0New translations en-us.json (German)📊 Changes
1 file changed (+1 additions, -1 deletions)
View changed files
📝
src/app/auth/reset-password/ResetPasswordForm.tsx(+1 -1)📄 Description
Community Contribution License Agreement
By creating this pull request, I grant the project maintainers an unlimited,
perpetual license to use, modify, and redistribute these contributions under any terms they
choose, including both the AGPLv3 and the Fossorial Commercial license terms. I
represent that I have the right to grant this license for all contributed content.
Description
Problem/Motivation:
Orgs currently lack the flexibility to reset passwords for internal users. Additionally, improving user management by making "Name" a more prominent field and defaulting to a more intuitive tab for user details will enhance usability.
Solution/Approach:
This pull request introduces a comprehensive set of changes to address user management for password reset and basic user details. I've added a dedicated "Security" tab within settings menu, allowing administrators to define the password reset token's validity period. This is implemented with a new API endpoint, updated backend logic for password resets, and corresponding frontend changes. I've also refined the user creation and management flows to incorporate the user's name more effectively and adjusted the default user details view for better UX.
Key Features & Changes:
updateOrgSecurity(PUT/org/{orgId}/security) for securely updating organization security parameters. This endpoint is protected with proper admin authorization.Technical Details:
Backend Changes:
server/routers/org/updateOrgSecurity.ts: Defines the new API endpoint responsible for handling updates to organization security settings, including thepasswordResetTokenExpiryHours.server/routers/external.ts: Adds thePUT /org/{orgId}/securityroute, making the new endpoint accessible.server/routers/user/adminResetUserPassword.ts: Modified to fetch and use thepasswordResetTokenExpiryHoursfrom the organization's settings when generating a password reset token.Frontend Changes:
src/app/[orgId]/settings/general/layout.tsx: Updated to include navigation to the new "Security" tab within the organization settings layout.src/app/[orgId]/settings/general/security/page.tsx: Contains the React component for the security settings form, allowing administrators to configure the token expiration.src/app/[orgId]/settings/access/users/[userId]/page.tsx: Modified the default page to "Details" tab when viewing individual user profiles.Database Integration:
passwordResetTokenExpiryHours, has been added to theorgstable.How to test?
Scenario 1: Configure Password Reset Token Expiration
orgstable for the corresponding organization and confirmpasswordResetTokenExpiryHoursis set to 12.Scenario 2: User Name and Default Tab
Screenshots
User Account Password Reset Screen.
Password Reset Option No SMTP
Password Reset Option With SMTP & Email UI
User Password Reset UI Dialog (After getting the URL)
Two-factor authentication prompt when resetting password via generated link
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.