cache in memory
This commit is contained in:
@@ -101,7 +101,7 @@ impl<'r> FromRequest<'r> for CurrentUser {
|
||||
Some(CurrentUser::from_hash(&rconn, rh.hash_with_salt(sp[1])).await)
|
||||
} else {
|
||||
let db = try_outcome!(request.guard::<Db>().await);
|
||||
if let Some(u) = User::get_by_token(&db, &rconn, token).await {
|
||||
if let Some(u) = User::get_by_token(&db, token).await {
|
||||
let namehash = rh.hash_with_salt(&u.name);
|
||||
let user_base = CurrentUser::from_hash(&rconn, namehash).await;
|
||||
Some(CurrentUser {
|
||||
|
||||
Reference in New Issue
Block a user