- Some(token_cookie) =>
- match connection.authentication_async(token_cookie.value(), &client_ip, &client_user_agent).await {
- Ok(db::AuthenticationResult::NotValidToken) =>
- // TODO: remove cookie?
- None,
- Ok(db::AuthenticationResult::Ok(user_id)) =>
- match connection.load_user_async(user_id).await {
- Ok(user) =>
- Some(user),
- Err(error) => {
- error!("Error during authentication: {}", error);
- None
- }
- },
- Err(error) => {
- error!("Error during authentication: {}", error);
- None
- },
- },
- None => None
+ Some(token_cookie) => match connection
+ .authentication_async(token_cookie.value(), &client_ip, &client_user_agent)
+ .await
+ {
+ Ok(db::AuthenticationResult::NotValidToken) =>
+ // TODO: remove cookie?
+ {
+ None
+ }
+ Ok(db::AuthenticationResult::Ok(user_id)) => {
+ match connection.load_user_async(user_id).await {
+ Ok(user) => Some(user),
+ Err(error) => {
+ error!("Error during authentication: {}", error);
+ None
+ }
+ }
+ }
+ Err(error) => {
+ error!("Error during authentication: {}", error);
+ None
+ }
+ },
+ None => None,