Added has_password to RegisteredUser
This commit is contained in:
parent
abe3c00fbf
commit
3c7d3457ef
|
@ -350,6 +350,17 @@ impl<UserData: Serialize + DeserializeOwned> RegisteredUser<UserData> {
|
|||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Check if the user has a password set
|
||||
///
|
||||
/// Since authentication is done using client certificates, users aren't required to
|
||||
/// set a password up front. In some cases, it may be useful to know if a user has or
|
||||
/// has not set a password yet.
|
||||
///
|
||||
/// This returns `true` if the user has a password set, or `false` otherwise
|
||||
pub fn has_password(&self) -> bool {
|
||||
self.inner.pass_hash.is_some()
|
||||
}
|
||||
}
|
||||
|
||||
impl<UserData: Serialize + DeserializeOwned> std::ops::Drop for RegisteredUser<UserData> {
|
||||
|
|
Loading…
Reference in a new issue