mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Added username_to_uuid convenience function to LoginProvider
This commit is contained in:
parent
2b0c1e89f3
commit
2c55afcfa9
@ -1,4 +1,4 @@
|
||||
use authc::{AuthClient, AuthToken, Uuid};
|
||||
use authc::{AuthClient, AuthToken, Uuid, AuthClientError};
|
||||
use common::msg::RegisterError;
|
||||
use hashbrown::HashMap;
|
||||
use std::str::FromStr;
|
||||
@ -103,4 +103,8 @@ impl LoginProvider {
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
pub fn username_to_uuid(&self, username: &str) -> Result<Uuid, AuthClientError> {
|
||||
self.auth_server.map_or_else(|| Ok(derive_uuid(username)), |username| auth.username_to_uuid(username))
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user