mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2026-02-05 00:29:40 +03:00
trim() the login email field: Android might add trailing spaces #1225
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @hitech95 on GitHub (Mar 3, 2022).
Subject of the issue
Android might add trailing space to email on login input
Deployment environment
Install method: Docker Compose
Clients used: Android Client
Reverse proxy and version: traefik v2
PostgreSQL version: PostgreSQL 11.15 (Debian 11.15-1.pgdg90+1) on x86_64-pc-linux-gnu
Other relevant details:
Steps to reproduce
[2022-03-02 22:12:09.086][vaultwarden::api::identity][ERROR] Username or password is incorrect. Try again. IP: x.x.x.x. Username: xxxxxx@gmail.com .https://github.com/dani-garcia/vaultwarden/blob/main/src/api/identity.rs#L104
The issue seems not to be present using the official server. (I have not tried with self hosted one)
Expected behaviour
Server perform trim on input email berfore looking for the user in the database.
Actual behaviour
Login is rejected
Troubleshooting data
@jeda commented on GitHub (Mar 3, 2022):
Can reproduce on web vault too. Since autocomplete is happy to do this, it's probably best user-experience speaking if it is trimmed, for safety.
(For some reason though,
/api/accounts/preloginsends{ email: "test@example.com" }while/identity/connect/tokensends{ "username": "test@example.com " }. Weird.)