Basic implementation of websocket
This commit is contained in:
@@ -28,6 +28,16 @@ pub enum AuthenticatedMethod {
|
||||
Token(APIToken),
|
||||
}
|
||||
|
||||
impl AuthenticatedMethod {
|
||||
pub fn light_str(&self) -> String {
|
||||
match self {
|
||||
AuthenticatedMethod::Cookie => "Cookie".to_string(),
|
||||
AuthenticatedMethod::Dev => "DevAuthentication".to_string(),
|
||||
AuthenticatedMethod::Token(t) => format!("Token({:?} - {})", t.id, t.base.name),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub struct AuthExtractor {
|
||||
pub user: User,
|
||||
pub method: AuthenticatedMethod,
|
||||
|
||||
Reference in New Issue
Block a user