claude rework
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
use super::jwt;
|
||||
use actix_web::dev::ServiceRequest;
|
||||
|
||||
pub fn check_password(password: String) -> Result<String, &'static str> {
|
||||
pub fn check_password(password: String) -> Result<i32, &'static str> {
|
||||
match jwt::JwtToken::decode(password) {
|
||||
Ok(_token) => Ok(String::from("passed")),
|
||||
Ok(token) => Ok(token.user_id),
|
||||
Err(message) => Err(message),
|
||||
}
|
||||
}
|
||||
@@ -37,7 +37,7 @@ mod processes_test {
|
||||
let result = check_password(password_string);
|
||||
|
||||
match result {
|
||||
Ok(check) => assert_eq!("passed", check),
|
||||
Ok(user_id) => assert_eq!(32, user_id),
|
||||
_ => panic!("Check correct password failed."),
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user