diff options
author | Toby Vincent <tobyv@tobyvin.dev> | 2024-04-16 14:52:07 -0500 |
---|---|---|
committer | Toby Vincent <tobyv@tobyvin.dev> | 2024-04-16 14:54:21 -0500 |
commit | 917293785bffdd64d467e7d69b5645099b21d5e9 (patch) | |
tree | a4fa3b7f30b1173c3e462a3dfae2d70a49890aed /src/api/users.rs | |
parent | 22c72bba9819475509e901ffba4e38ed30d13dd3 (diff) |
fix(auth): move credential data from header ...
...into JSON value to allow for serving the auth endpoint as a protected
micro-service in the future
Diffstat (limited to 'src/api/users.rs')
-rw-r--r-- | src/api/users.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/api/users.rs b/src/api/users.rs index 68986e7..c8a390d 100644 --- a/src/api/users.rs +++ b/src/api/users.rs @@ -5,7 +5,7 @@ use axum::{ response::IntoResponse, Json, }; -use axum_extra::{headers::Authorization, routing::Resource, TypedHeader}; +use axum_extra::routing::Resource; use serde::{Deserialize, Serialize}; use sqlx::FromRow; use time::OffsetDateTime; @@ -57,10 +57,10 @@ pub async fn create( return Err(Error::EmailExists); } - // TODO: Move this into a micro service + // TODO: Move this into a micro service, possibly behind a feature flag. let (status, (access, refresh)) = crate::auth::credentials::create( State(state.clone()), - TypedHeader(Authorization::basic(&email, &password)), + Json(crate::auth::credentials::Credential { password }), ) .await?; |