mirror of https://github.com/raftario/filite.git
Fix auth
This commit is contained in:
parent
820a82bd60
commit
d0a8c2cb96
|
@ -32,7 +32,7 @@ async fn user(header: HeaderValue, db: &Db, config: &Config) -> Result<User, Rej
|
|||
.or_500()?
|
||||
.or_unauthorized("Invalid Credentials")?;
|
||||
|
||||
let valid = !task::block_in_place(|| {
|
||||
let valid = task::block_in_place(|| {
|
||||
verify(
|
||||
&user.password_hash,
|
||||
credentials.password().as_bytes(),
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
use crate::config::Config;
|
||||
use sled::Db;
|
||||
use tracing_subscriber::fmt::format::FmtSpan;
|
||||
use tracing_subscriber::{fmt::format::FmtSpan, EnvFilter};
|
||||
use warp::http::StatusCode;
|
||||
|
||||
fn setup() -> (&'static Config, &'static Db) {
|
||||
tracing_subscriber::fmt()
|
||||
.with_env_filter("debug")
|
||||
.with_env_filter(EnvFilter::try_from_default_env().unwrap_or_else(|_| "warn".into()))
|
||||
.with_span_events(FmtSpan::CLOSE)
|
||||
.try_init()
|
||||
.ok();
|
||||
|
|
Loading…
Reference in New Issue