fix disconnect bug"
This commit is contained in:
parent
e7e8e39acb
commit
c42d895e59
@ -18,7 +18,7 @@ use mnml_core::player::{Player};
|
||||
use http::MnmlHttpError;
|
||||
use names::{name as generate_name};
|
||||
use mtx::{Mtx, FREE_MTX};
|
||||
use pg::{Db, instance_delete, construct_spawn, instance_practice};
|
||||
use pg::{Db, instance_delete, construct_spawn};
|
||||
use img;
|
||||
|
||||
static PASSWORD_MIN_LEN: usize = 3;
|
||||
|
||||
@ -198,7 +198,10 @@ impl Handler for Connection {
|
||||
if cookie.name() == TOKEN_HEADER {
|
||||
let db = self.pool.get().unwrap();
|
||||
match account::from_token(&db, &cookie.value().to_string()) {
|
||||
Ok(a) => self.user = Box::new(Authenticated::new(a, self.ws.clone(), self.events.clone(), self.pool.clone())),
|
||||
Ok(a) => {
|
||||
self.id = a.id;
|
||||
self.user = Box::new(Authenticated::new(a, self.ws.clone(), self.events.clone(), self.pool.clone()));
|
||||
},
|
||||
Err(_) => return unauth(),
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user