refactor: clients now have a single websocket that handles all rooms the user is in

This commit is contained in:
2026-01-16 11:35:07 +01:00
parent 376353833c
commit 37e6bb25fc
8 changed files with 74 additions and 66 deletions

View File

@@ -67,11 +67,15 @@ pub fn verify_jwt(headers: HeaderMap) -> Result<Claims, (StatusCode, String)> {
.and_then(|s| s.strip_prefix("Bearer "))
.ok_or((StatusCode::UNAUTHORIZED, "Missing token".to_string()))?;
verify_jwt_string(&token.to_string())
}
pub fn verify_jwt_string(token: &String) -> Result<Claims, (StatusCode, String)> {
let secret =
std::env::var("FRANGIPANE_JWT_SECRET").unwrap_or_else(|_| DEFAULT_SECRET_KEY.to_string());
decode::<Claims>(
token,
token.as_str(),
&DecodingKey::from_secret(secret.as_ref()),
&Validation::default(),
)