From fe67dbb96c1a86e10b9780dab117e5f19013b52d Mon Sep 17 00:00:00 2001 From: Conrad Ludgate Date: Tue, 28 Feb 2023 15:46:24 +0000 Subject: [PATCH] fix registration (#740) --- atuin-server/src/handlers/user.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/atuin-server/src/handlers/user.rs b/atuin-server/src/handlers/user.rs index 677e7c65..9e145d3c 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( #[instrument(skip_all)] pub async fn register( - settings: Extension, state: State>, Json(register): Json, ) -> Result, 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),