Fix authenticated track insertion
This commit is contained in:
parent
205a3b165e
commit
d7285a84bb
3 changed files with 58 additions and 41 deletions
|
|
@ -65,8 +65,11 @@ impl ActiveModel {
|
|||
impl Model {
|
||||
pub fn check_password(
|
||||
self,
|
||||
password: impl AsRef<[u8]>,
|
||||
) -> std::result::Result<Self, Either<Status, ErrorResponder>> {
|
||||
match verify(password, &self.password_hash) {
|
||||
Ok(true) => Ok(self),
|
||||
Ok(false) => Err(Left(Status::Unauthorized)),
|
||||
Err(err) => Err(Right(Error::from(err).into())),
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue