Update packages (#15)
Rust Build / Rustfmt (push) Successful in 59s
Rust Build / Test Suite (push) Successful in 1m50s
Rust Build / Clippy (push) Successful in 1m12s
Rust Build / Check (push) Successful in 2m30s
Rust Build / build (push) Successful in 1m45s

Reviewed-on: phoenix/textsender_auth#15
This commit was merged in pull request #15.
This commit is contained in:
2026-06-13 19:06:51 -04:00
parent e9b59fc1dd
commit 7d2faba4f2
3 changed files with 9 additions and 9 deletions
+4 -4
View File
@@ -24,7 +24,7 @@ pub fn create_token(
message: String::from(MESSAGE),
issuer: String::from(ISSUER),
audiences: vec![String::from(AUDIENCE)],
id: *id,
user_id: *id,
};
textsender_models::token::create_token(provided_key, &resource, time::Duration::hours(4))
}
@@ -37,7 +37,7 @@ pub fn create_service_token(
message: String::from(SERVICE_SUBJECT),
issuer: String::from(ISSUER),
audiences: vec![String::from(AUDIENCE)],
id: *id,
user_id: *id,
};
textsender_models::token::create_token(provided, &resource, time::Duration::hours(1))
}
@@ -50,7 +50,7 @@ pub fn create_service_refresh_token(
message: String::from(SERVICE_SUBJECT),
issuer: String::from(ISSUER),
audiences: vec![String::from(AUDIENCE)],
id: *id,
user_id: *id,
};
textsender_models::token::create_token(key, &resource, time::Duration::hours(4))
}
@@ -67,7 +67,7 @@ pub fn verify_token(key: &String, token: &String) -> bool {
pub fn extract_id_from_token(key: &String, token: &String) -> Result<uuid::Uuid, std::io::Error> {
match get_payload(key, token) {
Ok((payload, _header)) => match payload.claim("id") {
Ok((payload, _header)) => match payload.claim("user_id") {
Some(id) => match uuid::Uuid::parse_str(id.as_str().unwrap()) {
Ok(extracted) => Ok(extracted),
Err(err) => Err(std::io::Error::other(err.to_string())),