[PR #3263] [MERGED] Add function to fetch user by email address #3254

Closed
opened 2026-03-03 09:42:07 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/dani-garcia/vaultwarden/pull/3263
Author: @mittler-works
Created: 2/20/2023
Status: Merged
Merged: 2/21/2023
Merged by: @dani-garcia

Base: mainHead: search_user_by_email


📝 Commits (1)

  • 8ae799a Add function to fetch user by email address

📊 Changes

1 file changed (+13 additions, -0 deletions)

View changed files

📝 src/api/admin.rs (+13 -0)

📄 Description

In my opinion, as an admin, it is nice to be able to find users by email address as well. This makes Vaultwarden more compatible with other systems (e.g. for user management). Currently I use the get_users_json route to fetch all users and then filter the result, but this is suboptimal as the number of users grows.

The user model already provides a corresponding function (here), I just added a route in the admin controller to call this function.

Just as /users/overview, /users/by-mail/<mail> should not conflict with /users/<uuid>.


🔄 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/dani-garcia/vaultwarden/pull/3263 **Author:** [@mittler-works](https://github.com/mittler-works) **Created:** 2/20/2023 **Status:** ✅ Merged **Merged:** 2/21/2023 **Merged by:** [@dani-garcia](https://github.com/dani-garcia) **Base:** `main` ← **Head:** `search_user_by_email` --- ### 📝 Commits (1) - [`8ae799a`](https://github.com/dani-garcia/vaultwarden/commit/8ae799a7716549d25a21004daab099fe05e03be7) Add function to fetch user by email address ### 📊 Changes **1 file changed** (+13 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `src/api/admin.rs` (+13 -0) </details> ### 📄 Description In my opinion, as an admin, it is nice to be able to find users by email address as well. This makes Vaultwarden more compatible with other systems (e.g. for user management). Currently I use the `get_users_json` route to fetch all users and then filter the result, but this is suboptimal as the number of users grows. The user model already provides a corresponding function ([here](https://github.com/dani-garcia/vaultwarden/blob/main/src/db/models/user.rs#L362-L371)), I just added a route in the admin controller to call this function. Just as `/users/overview`, `/users/by-mail/<mail>` should not conflict with `/users/<uuid>`. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-03 09:42:07 +03: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/vaultwarden#3254
No description provided.