mirror of
https://github.com/mCaptcha/mCaptcha.git
synced 2026-02-11 18:15:39 +00:00
feat: get password using either username or email
This commit is contained in:
@@ -30,10 +30,19 @@ pub async fn database_works<'a, T: MCDatabase>(db: &T, p: &Register<'a>) {
|
||||
db.register(p).await.unwrap();
|
||||
|
||||
assert_eq!(
|
||||
db.get_password(p.username).await.unwrap(),
|
||||
db.get_password(&Login::Username(p.username)).await.unwrap(),
|
||||
p.hash,
|
||||
"user password matches"
|
||||
);
|
||||
|
||||
assert_eq!(
|
||||
db.get_password(&Login::Email(p.email.as_ref().unwrap()))
|
||||
.await
|
||||
.unwrap(),
|
||||
p.hash,
|
||||
"user password matches"
|
||||
);
|
||||
|
||||
assert!(
|
||||
db.email_exists(p.email.as_ref().unwrap()).await.unwrap(),
|
||||
"user is registered so email should exsit"
|
||||
|
||||
Reference in New Issue
Block a user