Skip to content

Commit

Permalink
fix registration (atuinsh#740)
Browse files Browse the repository at this point in the history
  • Loading branch information
conradludgate authored Feb 28, 2023
1 parent b80f91c commit fe67dbb
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions atuin-server/src/handlers/user.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use std::borrow::Borrow;

use axum::{
extract::{Path, State},
Extension, Json,
Json,
};
use http::StatusCode;
use sodiumoxide::crypto::pwhash::argon2id13;
Expand All @@ -14,7 +14,6 @@ use crate::{
database::Database,
models::{NewSession, NewUser},
router::AppState,
settings::Settings,
};

use atuin_common::api::*;
Expand Down Expand Up @@ -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),
Expand Down

0 comments on commit fe67dbb

Please sign in to comment.