diff options
author | Conrad Ludgate <conradludgate@gmail.com> | 2023-02-28 15:46:24 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-28 15:46:24 +0000 |
commit | fe67dbb96c1a86e10b9780dab117e5f19013b52d (patch) | |
tree | 84724673cd34790fa249796009dd7b69d6a38c39 | |
parent | b80f91c6a2991708f2a5bf48a20809f80f95e7c3 (diff) |
fix registration (#740)
-rw-r--r-- | atuin-server/src/handlers/user.rs | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/atuin-server/src/handlers/user.rs b/atuin-server/src/handlers/user.rs index 677e7c658..9e145d3ca 100644 --- a/atuin-server/src/handlers/user.rs +++ b/atuin-server/src/handlers/user.rs @@ -2,7 +2,7 @@ use std::borrow::Borrow; use axum::{ extract::{Path, State}, - Extension, Json, + Json, }; use http::StatusCode; use sodiumoxide::crypto::pwhash::argon2id13; @@ -14,7 +14,6 @@ use crate::{ database::Database, models::{NewSession, NewUser}, router::AppState, - settings::Settings, }; use atuin_common::api::*; @@ -59,11 +58,10 @@ pub async fn get<DB: Database>( #[instrument(skip_all)] pub async fn register<DB: Database>( - settings: Extension<Settings>, state: State<AppState<DB>>, Json(register): Json<RegisterRequest>, ) -> Result<Json<RegisterResponse>, ErrorResponseStatus<'static>> { - if !settings.open_registration { + if !state.settings.open_registration { return Err( ErrorResponse::reply("this server is not open for registrations") .with_status(StatusCode::BAD_REQUEST), |