mirror of
https://github.com/stoatchat/stoatchat.git
synced 2026-07-14 13:36:59 +00:00
Push env variables to rAuth + cargo fmt.
This commit is contained in:
@@ -41,7 +41,7 @@ pub enum ClientboundNotification {
|
||||
Message(Message),
|
||||
MessageUpdate {
|
||||
id: String,
|
||||
data: JsonValue
|
||||
data: JsonValue,
|
||||
},
|
||||
MessageDelete {
|
||||
id: String,
|
||||
@@ -50,7 +50,7 @@ pub enum ClientboundNotification {
|
||||
ChannelCreate(Channel),
|
||||
ChannelUpdate {
|
||||
id: String,
|
||||
data: JsonValue
|
||||
data: JsonValue,
|
||||
},
|
||||
ChannelGroupJoin {
|
||||
id: String,
|
||||
|
||||
@@ -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