diff options
author | BlackDex <[email protected]> | 2022-03-20 18:51:24 +0100 |
---|---|---|
committer | BlackDex <[email protected]> | 2022-03-20 18:51:24 +0100 |
commit | b0faaf25277fbbd2aea85b9c38868eb66ab45cc8 (patch) | |
tree | ce71870fe49a94aea2e7f6bdbb7684e844cd3df6 /src/api/identity.rs | |
parent | 8d06d9c1111d642d0c2d03c1d29b0170e79f0c11 (diff) | |
download | vaultwarden-b0faaf25277fbbd2aea85b9c38868eb66ab45cc8.tar.gz vaultwarden-b0faaf25277fbbd2aea85b9c38868eb66ab45cc8.zip |
Several updates and fixes
- Removed all `thread::sleep` and use `tokio::time::sleep` now.
This solves an issue with updating to Bullseye ( Resolves #1998 )
- Updated all Debian images to Bullseye
- Added MiMalloc feature and enabled it by default for Alpine based images
This increases performance for the Alpine images because the default
memory allocator for MUSL based binaries isn't that fast
- Updated `dotenv` to `dotenvy` a maintained and updated fork
- Fixed an issue with a newer jslib (not fully released yet)
That version uses a different endpoint for `prelogin` Resolves #2378 )
Diffstat (limited to 'src/api/identity.rs')
-rw-r--r-- | src/api/identity.rs | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/api/identity.rs b/src/api/identity.rs index 2ed889bb..fc7ffcec 100644 --- a/src/api/identity.rs +++ b/src/api/identity.rs @@ -9,8 +9,9 @@ use serde_json::Value; use crate::{ api::{ + core::accounts::{PreloginData, _prelogin}, core::two_factor::{duo, email, email::EmailTokenData, yubikey}, - ApiResult, EmptyResult, JsonResult, + ApiResult, EmptyResult, JsonResult, JsonUpcase, }, auth::ClientIp, db::{models::*, DbConn}, @@ -19,7 +20,7 @@ use crate::{ }; pub fn routes() -> Vec<Route> { - routes![login] + routes![login, prelogin] } #[post("/connect/token", data = "<data>")] @@ -449,6 +450,11 @@ async fn _json_err_twofactor(providers: &[i32], user_uuid: &str, conn: &DbConn) Ok(result) } +#[post("/accounts/prelogin", data = "<data>")] +async fn prelogin(data: JsonUpcase<PreloginData>, conn: DbConn) -> Json<Value> { + _prelogin(data, conn).await +} + // https://github.com/bitwarden/jslib/blob/master/common/src/models/request/tokenRequest.ts // https://github.com/bitwarden/mobile/blob/master/src/Core/Models/Request/TokenRequest.cs #[derive(Debug, Clone, Default, FromForm)] |