diff --git a/Cargo.lock b/Cargo.lock index 8d91c0b5..c9da4d7e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -612,6 +612,12 @@ version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" +[[package]] +name = "base64" +version = "0.23.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac07cdecf99051d9a5238b80f35af32cdeba5b336e55d957b318b50137e18da5" + [[package]] name = "bigdecimal" version = "0.4.9" @@ -1418,7 +1424,7 @@ dependencies = [ "async-lock", "async-trait", "axum", - "base64 0.22.1", + "base64 0.23.1", "console-subscriber", "cookie", "educe 0.7.4", @@ -1473,7 +1479,7 @@ name = "divviup-cli" version = "0.5.0-alpha.2" dependencies = [ "anyhow", - "base64 0.22.1", + "base64 0.23.1", "clap", "colored", "const_format", @@ -1503,7 +1509,7 @@ name = "divviup-client" version = "0.5.0-alpha.2" dependencies = [ "axum", - "base64 0.22.1", + "base64 0.23.1", "divviup-api", "divviup-client", "email_address", @@ -4842,7 +4848,7 @@ version = "0.5.0-alpha.2" dependencies = [ "async-trait", "axum", - "base64 0.22.1", + "base64 0.23.1", "bytes", "divviup-api", "fastrand", diff --git a/Cargo.toml b/Cargo.toml index c71a005e..2e90cda4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,7 +23,7 @@ aes-gcm = "0.11.0" async-lock = "3.4.1" async-trait = "0.1" axum = "0.8" -base64 = "0.22.1" +base64 = "0.23.1" bytes = "1" clap = "4.6.1" colored = "3.1.1" diff --git a/src/handler/session_store.rs b/src/handler/session_store.rs index 4f4d5496..137ac53f 100644 --- a/src/handler/session_store.rs +++ b/src/handler/session_store.rs @@ -4,7 +4,7 @@ use sea_orm::{ sea_query::{any, OnConflict}, ColumnTrait, EntityTrait, IntoActiveModel, QueryFilter, }; -use std::collections::HashMap; +use std::{collections::HashMap, str::FromStr}; use time::{Duration, OffsetDateTime}; use tower_sessions::{ cookie::{Key, SameSite}, @@ -100,9 +100,8 @@ impl tower_store::SessionStore for TowerSessionStore { .map(|m| { let data: HashMap = serde_json::from_value(m.data) .map_err(|e| tower_store::Error::Decode(e.to_string()))?; - let id: TowerSessionId = m.id.parse().map_err(|e: base64::DecodeSliceError| { - tower_store::Error::Decode(e.to_string()) - })?; + let id = TowerSessionId::from_str(&m.id) + .map_err(|e| tower_store::Error::Decode(e.to_string()))?; Ok(Record { id, data,