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_500()?
|
||||||
.or_unauthorized("Invalid Credentials")?;
|
.or_unauthorized("Invalid Credentials")?;
|
||||||
|
|
||||||
let valid = !task::block_in_place(|| {
|
let valid = task::block_in_place(|| {
|
||||||
verify(
|
verify(
|
||||||
&user.password_hash,
|
&user.password_hash,
|
||||||
credentials.password().as_bytes(),
|
credentials.password().as_bytes(),
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
use crate::config::Config;
|
use crate::config::Config;
|
||||||
use sled::Db;
|
use sled::Db;
|
||||||
use tracing_subscriber::fmt::format::FmtSpan;
|
use tracing_subscriber::{fmt::format::FmtSpan, EnvFilter};
|
||||||
use warp::http::StatusCode;
|
use warp::http::StatusCode;
|
||||||
|
|
||||||
fn setup() -> (&'static Config, &'static Db) {
|
fn setup() -> (&'static Config, &'static Db) {
|
||||||
tracing_subscriber::fmt()
|
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)
|
.with_span_events(FmtSpan::CLOSE)
|
||||||
.try_init()
|
.try_init()
|
||||||
.ok();
|
.ok();
|
||||||
|
|
Loading…
Reference in New Issue