Remove printouts
This commit is contained in:
parent
ef0e9f16b8
commit
ac3a21f3f0
@ -24,11 +24,7 @@ pub fn routes(core: Core) -> Router {
|
|||||||
"/api/v1/health",
|
"/api/v1/health",
|
||||||
get({
|
get({
|
||||||
let core = core.clone();
|
let core = core.clone();
|
||||||
move || async {
|
move || healthcheck(core)
|
||||||
let result = healthcheck(core).await;
|
|
||||||
println!("status: {:?}", String::from_utf8(result.to_owned()));
|
|
||||||
result
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
.layer(
|
.layer(
|
||||||
CorsLayer::new()
|
CorsLayer::new()
|
||||||
@ -40,11 +36,7 @@ pub fn routes(core: Core) -> Router {
|
|||||||
"/api/v1/auth",
|
"/api/v1/auth",
|
||||||
post({
|
post({
|
||||||
let core = core.clone();
|
let core = core.clone();
|
||||||
move |req: Json<AuthRequest>| wrap_handler(|| async {
|
move |req: Json<AuthRequest>| wrap_handler(|| check_password(core, req))
|
||||||
let password_result = check_password(core, req).await;
|
|
||||||
println!("check_auth result: {:?}", password_result);
|
|
||||||
password_result
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
.layer(
|
.layer(
|
||||||
CorsLayer::new()
|
CorsLayer::new()
|
||||||
@ -142,7 +134,15 @@ mod test {
|
|||||||
let password_exp = Utc::now() + Duration::from_secs(5);
|
let password_exp = Utc::now() + Duration::from_secs(5);
|
||||||
let memory_db: Option<PathBuf> = None;
|
let memory_db: Option<PathBuf> = None;
|
||||||
let conn = DbConn::new(memory_db);
|
let conn = DbConn::new(memory_db);
|
||||||
let _admin_id = conn.create_user("admin", "aoeu", true, AccountState::PasswordReset(password_exp)).await.unwrap();
|
let _admin_id = conn
|
||||||
|
.create_user(
|
||||||
|
"admin",
|
||||||
|
"aoeu",
|
||||||
|
true,
|
||||||
|
AccountState::PasswordReset(password_exp),
|
||||||
|
)
|
||||||
|
.await
|
||||||
|
.unwrap();
|
||||||
let core = Core::new(FsAssets::new(PathBuf::from("/home/savanni/Pictures")), conn);
|
let core = Core::new(FsAssets::new(PathBuf::from("/home/savanni/Pictures")), conn);
|
||||||
let app = routes(core.clone());
|
let app = routes(core.clone());
|
||||||
let server = TestServer::new(app).unwrap();
|
let server = TestServer::new(app).unwrap();
|
||||||
@ -316,7 +316,6 @@ mod test {
|
|||||||
.await;
|
.await;
|
||||||
response.assert_status_ok();
|
response.assert_status_ok();
|
||||||
let session_id = assert_matches!(response.json(), Some(AuthResponse::PasswordReset(session_id)) => session_id);
|
let session_id = assert_matches!(response.json(), Some(AuthResponse::PasswordReset(session_id)) => session_id);
|
||||||
println!("it_returns_user_profile: {}", session_id);
|
|
||||||
|
|
||||||
let response = server
|
let response = server
|
||||||
.get("/api/v1/user")
|
.get("/api/v1/user")
|
||||||
|
Loading…
Reference in New Issue
Block a user