Skip to content

Commit

Permalink
upd libaccount
Browse files Browse the repository at this point in the history
  • Loading branch information
JieningYu committed Dec 26, 2023
1 parent 3a832b9 commit 77f93b8
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,11 @@ pub struct Auth {
}

impl Auth {
#[inline]
pub fn new(account: u64, token: String) -> Self {
Self { account, token }
}

const KEY: &str = "Authorization";

#[cfg(test)]
Expand Down
7 changes: 7 additions & 0 deletions src/tests/account.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ async fn creation() {
.await
.expect("captcha not sent");

// Verify the account.

// Simulates a wrong captcha.
let wrong_captcha = sms4_backend::account::verify::Captcha::from(captcha.into_inner() + 1);
let res = req!(route => REGISTER,
Expand Down Expand Up @@ -88,3 +90,8 @@ async fn creation() {
)
)
}

#[tokio::test]
async fn login() {
let (state, route) = router();
}

0 comments on commit 77f93b8

Please sign in to comment.