mirror of
https://github.com/stoatchat/stoatchat.git
synced 2026-07-14 21:47:02 +00:00
Push env variables to rAuth + cargo fmt.
This commit is contained in:
@@ -12,7 +12,10 @@ use futures::{pin_mut, prelude::*};
|
||||
use hive_pubsub::PubSub;
|
||||
use log::{debug, info};
|
||||
use many_to_many::ManyToMany;
|
||||
use rauth::{auth::{Auth, Session}, options::Options};
|
||||
use rauth::{
|
||||
auth::{Auth, Session},
|
||||
options::Options,
|
||||
};
|
||||
use std::collections::HashMap;
|
||||
use std::net::SocketAddr;
|
||||
use std::sync::{Arc, Mutex, RwLock};
|
||||
@@ -84,9 +87,10 @@ async fn accept(stream: TcpStream) {
|
||||
}
|
||||
}
|
||||
|
||||
if let Ok(validated_session) = Auth::new(get_collection("accounts"), Options::new())
|
||||
.verify_session(new_session)
|
||||
.await
|
||||
if let Ok(validated_session) =
|
||||
Auth::new(get_collection("accounts"), Options::new())
|
||||
.verify_session(new_session)
|
||||
.await
|
||||
{
|
||||
let id = validated_session.user_id.clone();
|
||||
if let Ok(user) = (Ref { id: id.clone() }).fetch_user().await {
|
||||
|
||||
Reference in New Issue
Block a user