diff --git a/crates/forge-core/migrations/0066_session_ip.sql b/crates/forge-core/migrations/0066_session_ip.sql new file mode 100644 index 0000000..6f97535 --- /dev/null +++ b/crates/forge-core/migrations/0066_session_ip.sql @@ -0,0 +1,6 @@ +-- Sessions record the client IP. `ip` is the address the session signed in from, `last_ip` the one +-- of the most recent request. Both are NULL for sessions made before this migration. Applied by +-- store/migrate.rs. + +ALTER TABLE sessions ADD COLUMN ip TEXT; +ALTER TABLE sessions ADD COLUMN last_ip TEXT; diff --git a/crates/forge-core/src/model.rs b/crates/forge-core/src/model.rs index 8cdcdbe..84cfb5a 100644 --- a/crates/forge-core/src/model.rs +++ b/crates/forge-core/src/model.rs @@ -120,6 +120,10 @@ pub struct Session { pub expires_at: String, pub last_seen: String, pub user_agent: Option, + /// The address the session signed in from. + pub ip: Option, + /// The address of the most recent request. + pub last_ip: Option, } const REDACTED: &str = ""; @@ -158,6 +162,8 @@ impl std::fmt::Debug for Session { .field("expires_at", &self.expires_at) .field("last_seen", &self.last_seen) .field("user_agent", &self.user_agent) + .field("ip", &self.ip) + .field("last_ip", &self.last_ip) .finish() } } @@ -247,6 +253,8 @@ mod tests { expires_at: "later".into(), last_seen: "now".into(), user_agent: None, + ip: None, + last_ip: None, }; let dbg = format!("{user:?} {session:?}"); assert!(dbg.contains("\"\"")); diff --git a/crates/forge-core/src/store/migrate.rs b/crates/forge-core/src/store/migrate.rs index a067c9d..fd3d913 100644 --- a/crates/forge-core/src/store/migrate.rs +++ b/crates/forge-core/src/store/migrate.rs @@ -105,6 +105,7 @@ pub const MIGRATIONS: &[(u32, &str)] = &[ (63, include_str!("../../migrations/0063_web_push.sql")), (64, include_str!("../../migrations/0064_merge_queue.sql")), (65, include_str!("../../migrations/0065_hue_colours.sql")), + (66, include_str!("../../migrations/0066_session_ip.sql")), ]; /// The highest migration version this binary knows about. diff --git a/crates/forge-core/src/store/mod.rs b/crates/forge-core/src/store/mod.rs index 87c6ec5..949b38b 100644 --- a/crates/forge-core/src/store/mod.rs +++ b/crates/forge-core/src/store/mod.rs @@ -126,7 +126,8 @@ struct Inner { const USER_COLS: &str = "id, username, email, password_hash, is_admin, created_at, about, timezone, \ (SELECT hash FROM avatars WHERE avatars.user_id = users.id) AS avatar_hash, \ theme, language, kind, email_notifications, display_name, accent, accent_dark, base_light, base_dark, sidebar_side"; -const SESSION_COLS: &str = "id, user_id, csrf_token, created_at, expires_at, last_seen, user_agent"; +const SESSION_COLS: &str = + "id, user_id, csrf_token, created_at, expires_at, last_seen, user_agent, ip, last_ip"; const SSH_KEY_COLS: &str = "id, user_id, title, algorithm, key_blob, fingerprint, created_at, last_used_at"; const TOKEN_COLS: &str = "id, user_id, name, scopes, expires_at, created_at, last_used_at"; @@ -350,6 +351,7 @@ impl Store { csrf_token: &str, expires_at: &str, user_agent: Option<&str>, + ip: Option<&str>, ) -> Result { let now = now_stamp(); let session = Session { @@ -360,11 +362,13 @@ impl Store { expires_at: expires_at.to_string(), last_seen: now.clone(), user_agent: user_agent.map(str::to_owned), + ip: ip.map(str::to_owned), + last_ip: ip.map(str::to_owned), }; let conn = self.inner.conn.lock().await; conn.execute( - "INSERT INTO sessions (id, user_id, token_hash, csrf_token, created_at, expires_at, last_seen, user_agent) \ - VALUES (?1, ?2, ?3, ?4, ?5, ?6, ?7, ?8)", + "INSERT INTO sessions (id, user_id, token_hash, csrf_token, created_at, expires_at, last_seen, user_agent, ip, last_ip) \ + VALUES (?1, ?2, ?3, ?4, ?5, ?6, ?7, ?8, ?9, ?10)", ( session.id.clone(), session.user_id.clone(), @@ -374,6 +378,8 @@ impl Store { session.expires_at.clone(), now, session.user_agent.clone(), + session.ip.clone(), + session.last_ip.clone(), ), ) .await @@ -396,11 +402,12 @@ impl Store { .await } - pub async fn touch_session(&self, id: &str) -> Result<()> { + /// Records a request: bumps `last_seen`, and `last_ip` when the request's address is known. + pub async fn touch_session(&self, id: &str, ip: Option<&str>) -> Result<()> { let conn = self.inner.conn.lock().await; conn.execute( - "UPDATE sessions SET last_seen = ?2 WHERE id = ?1", - (id.to_string(), now_stamp()), + "UPDATE sessions SET last_seen = ?2, last_ip = COALESCE(?3, last_ip) WHERE id = ?1", + (id.to_string(), now_stamp(), ip.map(str::to_owned)), ) .await .map_err(db_err)?; @@ -1093,6 +1100,8 @@ fn map_session(row: &Row) -> Result { expires_at: col_text(row, 4)?, last_seen: col_text(row, 5)?, user_agent: col_opt_text(row, 6)?, + ip: col_opt_text(row, 7)?, + last_ip: col_opt_text(row, 8)?, }) } @@ -2580,15 +2589,15 @@ mod security_tests { // Scenario: deleting sessions except one keeps only the named session. let expiry = crate::time::stamp_after(std::time::Duration::from_secs(3600)); let keep = store - .create_session(&user.id, "h1", "c1", &expiry, None) + .create_session(&user.id, "h1", "c1", &expiry, None, None) .await .unwrap(); store - .create_session(&user.id, "h2", "c2", &expiry, None) + .create_session(&user.id, "h2", "c2", &expiry, None, None) .await .unwrap(); store - .create_session(&user.id, "h3", "c3", &expiry, None) + .create_session(&user.id, "h3", "c3", &expiry, None, None) .await .unwrap(); assert_eq!( diff --git a/crates/forge-core/src/store/suspension.rs b/crates/forge-core/src/store/suspension.rs index f5a052b..98b6db2 100644 --- a/crates/forge-core/src/store/suspension.rs +++ b/crates/forge-core/src/store/suspension.rs @@ -213,7 +213,7 @@ mod tests { // Scenario: suspending ends the user's sessions until it is lifted. store - .create_session(&other.id, "th", "csrf", "2999-01-01T00:00:00Z", None) + .create_session(&other.id, "th", "csrf", "2999-01-01T00:00:00Z", None, None) .await .unwrap(); assert!(store.session_by_token_hash("th").await.unwrap().is_some()); diff --git a/crates/forge-core/src/store/user_delete.rs b/crates/forge-core/src/store/user_delete.rs index 6d8452e..f02e5a0 100644 --- a/crates/forge-core/src/store/user_delete.rs +++ b/crates/forge-core/src/store/user_delete.rs @@ -582,7 +582,7 @@ mod tests { let fx = fixture().await; let expiry = crate::time::stamp_after(std::time::Duration::from_secs(3600)); fx.store - .create_session(&fx.tahinli.id, "sess-hash", "csrf", &expiry, None) + .create_session(&fx.tahinli.id, "sess-hash", "csrf", &expiry, None, None) .await .unwrap(); fx.store diff --git a/crates/forge-core/tests/integration/store_basic.rs b/crates/forge-core/tests/integration/store_basic.rs index 2755934..e5dc6fe 100644 --- a/crates/forge-core/tests/integration/store_basic.rs +++ b/crates/forge-core/tests/integration/store_basic.rs @@ -108,6 +108,7 @@ async fn sessions_respect_expiry() { "csrf-live", &stamp_after(Duration::from_secs(3600)), Some("agent/1"), + None, ) .await .unwrap(); @@ -118,6 +119,7 @@ async fn sessions_respect_expiry() { "csrf-dead", &stamp_after(Duration::from_secs(0)), None, + None, ) .await .unwrap(); @@ -147,7 +149,7 @@ async fn sessions_respect_expiry() { .is_none() ); - store.touch_session(&live.id).await.unwrap(); + store.touch_session(&live.id, None).await.unwrap(); let sessions = store.list_sessions(&user.id).await.unwrap(); assert_eq!(sessions.len(), 1, "expired sessions are not listed"); @@ -167,6 +169,7 @@ async fn sessions_respect_expiry() { "c2", &stamp_after(Duration::from_secs(60)), None, + None, ) .await .unwrap(); diff --git a/crates/forge-web/src/admin_cli.rs b/crates/forge-web/src/admin_cli.rs index 0f641d7..e99edc0 100644 --- a/crates/forge-web/src/admin_cli.rs +++ b/crates/forge-web/src/admin_cli.rs @@ -662,11 +662,11 @@ mod tests { .unwrap(); let expiry = forge_core::time::stamp_after(std::time::Duration::from_secs(3600)); store - .create_session(&user.id, "h1", "c1", &expiry, None) + .create_session(&user.id, "h1", "c1", &expiry, None, None) .await .unwrap(); store - .create_session(&user.id, "h2", "c2", &expiry, None) + .create_session(&user.id, "h2", "c2", &expiry, None, None) .await .unwrap(); diff --git a/crates/forge-web/src/auth.rs b/crates/forge-web/src/auth.rs index 48fcd1d..62388d3 100644 --- a/crates/forge-web/src/auth.rs +++ b/crates/forge-web/src/auth.rs @@ -16,6 +16,7 @@ use topcoat::cookie::{Cookie, Cookies, SameSite, cookies, time}; use topcoat::router::error::{forbidden, see_other}; use topcoat::router::request::{headers, uri}; +use crate::client_ip::client_addr; use crate::state::AppState; /// Logical cookie name. `override_prefix_host()` stores it as `__Host-forge_session`. @@ -66,7 +67,8 @@ pub async fn current_user(cx: &Cx) -> forge_core::Result else { return Ok(None); }; - store.touch_session(&session.id).await?; + let addr = client_addr(cx).to_string(); + store.touch_session(&session.id, Some(&addr)).await?; Ok(Some((user, session))) } @@ -74,6 +76,7 @@ pub async fn current_user(cx: &Cx) -> forge_core::Result pub async fn login(cx: &Cx, user: &User) -> forge_core::Result { let store = &app_context::(cx).store; let token = new_session_token(); + let addr = client_addr(cx).to_string(); let session = store .create_session( &user.id, @@ -81,6 +84,7 @@ pub async fn login(cx: &Cx, user: &User) -> forge_core::Result { &new_csrf_token(), &stamp_after(SESSION_TTL), user_agent(cx).as_deref(), + Some(&addr), ) .await?; // A new sign-in shows up in the user's session list in their other open tabs. @@ -356,6 +360,8 @@ mod tests { expires_at: String::new(), last_seen: String::new(), user_agent: None, + ip: None, + last_ip: None, } } diff --git a/crates/forge-web/src/client_ip.rs b/crates/forge-web/src/client_ip.rs index 157eb84..c4f608e 100644 --- a/crates/forge-web/src/client_ip.rs +++ b/crates/forge-web/src/client_ip.rs @@ -18,6 +18,12 @@ const FORWARDED_FOR: &str = "x-forwarded-for"; /// The client IP for this request, bucketed for throttling. Unix-socket requests have no peer and /// map to the unspecified address. pub fn client_ip(cx: &Cx) -> IpAddr { + bucket(client_addr(cx)) +} + +/// The exact client address for this request, normalized but not bucketed, for display and audit. +/// Unix-socket requests map to the unspecified address. +pub fn client_addr(cx: &Cx) -> IpAddr { let live = app_context::(cx).live(); let trusted = &live.trusted_proxies; let peer = remote_addr(cx).map(|addr| addr.ip()); @@ -27,27 +33,34 @@ pub fn client_ip(cx: &Cx) -> IpAddr { .filter_map(|value| value.to_str().ok()) .collect::>() .join(","); - resolve(peer, &forwarded, trusted) + resolve_addr(peer, &forwarded, trusted) } /// Pure form of [`client_ip`]: `forwarded` is the combined `X-Forwarded-For` value, or empty. +/// Only the tests use the bucketed form; the server takes [`client_ip`], which buckets itself. +#[cfg(test)] pub fn resolve(peer: Option, forwarded: &str, trusted: &[IpNet]) -> IpAddr { + bucket(resolve_addr(peer, forwarded, trusted)) +} + +/// Pure form of [`client_addr`]: the exact client address, normalized but not bucketed. +pub fn resolve_addr(peer: Option, forwarded: &str, trusted: &[IpNet]) -> IpAddr { let Some(peer) = peer.map(normalize) else { - return bucket(IpAddr::V4(Ipv4Addr::UNSPECIFIED)); + return IpAddr::V4(Ipv4Addr::UNSPECIFIED); }; if !is_trusted(peer, trusted) { - return bucket(peer); + return peer; } for entry in forwarded.rsplit(',') { let Ok(ip) = entry.trim().parse::() else { - return bucket(peer); + return peer; }; let ip = normalize(ip); if !is_trusted(ip, trusted) { - return bucket(ip); + return ip; } } - bucket(peer) + peer } fn is_trusted(ip: IpAddr, trusted: &[IpNet]) -> bool { diff --git a/crates/forge-web/src/i18n/mod.rs b/crates/forge-web/src/i18n/mod.rs index 3ef19e6..7f34170 100644 --- a/crates/forge-web/src/i18n/mod.rs +++ b/crates/forge-web/src/i18n/mod.rs @@ -260,6 +260,12 @@ pub enum Key { UnknownBrowser, ThisSession, RevokeAllOthers, + UserAgent, + SignInIp, + LastIp, + LastSeenAt, + ExpiresAt, + BackToSessions, // Metadata lines (see the helpers below for the words in between). Added, @@ -472,6 +478,12 @@ pub const ALL: &[Key] = &[ Key::UnknownBrowser, Key::ThisSession, Key::RevokeAllOthers, + Key::UserAgent, + Key::SignInIp, + Key::LastIp, + Key::LastSeenAt, + Key::ExpiresAt, + Key::BackToSessions, Key::Added, Key::LastUsed, Key::Created, @@ -864,6 +876,18 @@ pub fn t(lang: Lang, key: Key) -> &'static str { (UnknownBrowser, Tr) => "Bilinmeyen tarayıcı", (ThisSession, En) => "This session", (ThisSession, Tr) => "Bu oturum", + (UserAgent, En) => "User agent", + (UserAgent, Tr) => "Kullanıcı aracısı", + (SignInIp, En) => "Sign-in IP", + (SignInIp, Tr) => "Giriş IP adresi", + (LastIp, En) => "Last IP", + (LastIp, Tr) => "Son IP adresi", + (LastSeenAt, En) => "Last seen", + (LastSeenAt, Tr) => "Son görülme", + (ExpiresAt, En) => "Expires", + (ExpiresAt, Tr) => "Bitiş", + (BackToSessions, En) => "Back to sessions", + (BackToSessions, Tr) => "Oturumlara dön", (RevokeAllOthers, En) => "Revoke all other sessions", (RevokeAllOthers, Tr) => "Diğer tüm oturumları iptal et", @@ -1307,21 +1331,44 @@ mod tests { let cases: [(&str, Option<&str>, &str, Lang); 10] = [ ("stored en beats browser tr", Some("en"), "tr", Lang::En), ("stored tr with no header", Some("tr"), "", Lang::Tr), - ("auto follows browser", Some("auto"), "tr-TR,en;q=0.5", Lang::Tr), + ( + "auto follows browser", + Some("auto"), + "tr-TR,en;q=0.5", + Lang::Tr, + ), ("missing preference follows browser", None, "tr", Lang::Tr), ("no preference, no header", None, "", Lang::En), - ("highest q supported wins", None, "de,en;q=0.8,tr;q=0.9", Lang::Tr), + ( + "highest q supported wins", + None, + "de,en;q=0.8,tr;q=0.9", + Lang::Tr, + ), ("higher q for en", None, "en;q=0.9,tr;q=0.5", Lang::En), ("q=0 rejects tr", None, "tr;q=0,en", Lang::En), - ("unsupported tags fall back to en", None, "de,fr;q=0.9", Lang::En), - ("malformed q is ignored", None, "tr;q=oops,en;q=0.1", Lang::En), + ( + "unsupported tags fall back to en", + None, + "de,fr;q=0.9", + Lang::En, + ), + ( + "malformed q is ignored", + None, + "tr;q=oops,en;q=0.1", + Lang::En, + ), ]; for (name, stored, accept, want) in cases { let map = if accept.is_empty() { HeaderMap::new() } else { let mut map = HeaderMap::new(); - map.insert(ACCEPT_LANGUAGE, HeaderValue::from_str(accept).expect("ascii")); + map.insert( + ACCEPT_LANGUAGE, + HeaderValue::from_str(accept).expect("ascii"), + ); map }; assert_eq!(resolve(stored, &map), want, "case {name}"); diff --git a/crates/forge-web/src/pages/settings_security.rs b/crates/forge-web/src/pages/settings_security.rs index 81375e1..89bf0fc 100644 --- a/crates/forge-web/src/pages/settings_security.rs +++ b/crates/forge-web/src/pages/settings_security.rs @@ -1109,7 +1109,7 @@ mod tests { .unwrap(); let expiry = stamp_after(std::time::Duration::from_secs(3600)); store - .create_session(&user.id, &hash_token(TOKEN), CSRF, &expiry, None) + .create_session(&user.id, &hash_token(TOKEN), CSRF, &expiry, None, None) .await .unwrap(); let router = Router::builder() @@ -1234,7 +1234,10 @@ mod tests { &mismatch, ) .await; - assert!(reply.body.contains("do not match"), "mismatched confirmation"); + assert!( + reply.body.contains("do not match"), + "mismatched confirmation" + ); // An SSH key puts the user's address into the allowed-signers file. With no address // yet, the username is the principal. @@ -1310,6 +1313,7 @@ mod tests { "other", &expiry, None, + None, ) .await .unwrap(); @@ -1491,7 +1495,10 @@ mod tests { // The enrollment page shows the secret and the URI, not the codes. let page = send(&fx.router, "GET", "/settings/security", true, "").await; - assert!(page.body.contains(&totp::base32_encode(&shared)), "secret shown"); + assert!( + page.body.contains(&totp::base32_encode(&shared)), + "secret shown" + ); assert!( page.body.contains("otpauth://totp/forge:tahinli?secret="), "uri shown" diff --git a/crates/forge-web/src/pages/settings_sessions.rs b/crates/forge-web/src/pages/settings_sessions.rs index 9de0d0a..d113e52 100644 --- a/crates/forge-web/src/pages/settings_sessions.rs +++ b/crates/forge-web/src/pages/settings_sessions.rs @@ -1,12 +1,13 @@ -//! Page: web sessions (`/settings/sessions`). Revoke one or all other sessions. +//! Page: web sessions (`/settings/sessions`). Revoke one or all other sessions, and a detail page +//! per session (`/settings/sessions/{id}`). use forge_core::{AuditAction, Session}; use serde::Deserialize; use topcoat::Result; use topcoat::context::{Cx, app_context}; use topcoat::router::content::Form; -use topcoat::router::error::{SeeOther, see_other}; -use topcoat::router::{page, route}; +use topcoat::router::error::{SeeOther, not_found, see_other}; +use topcoat::router::{page, path_param_segment, route}; use topcoat::view::{View, component, view}; use crate::audit::{self, Actor, Target}; @@ -14,6 +15,7 @@ use crate::auth::{logout, require_csrf, require_user}; use crate::i18n::{self, Key, Lang, t}; use crate::state::AppState; use crate::views::{rel_time, shell}; +use crate::web_push::agent_label; #[derive(Deserialize)] struct RevokeForm { @@ -29,6 +31,23 @@ struct CsrfForm { csrf: String, } +/// A short title for a session: "Chrome on Linux", or the unknown-browser label. +fn session_label(lang: Lang, session: &Session) -> String { + session + .user_agent + .as_deref() + .map_or_else(|| t(lang, Key::UnknownBrowser).to_owned(), agent_label) +} + +/// " · " and the address the session was last seen at (or signed in from), for the list's meta +/// line. Empty when no address was recorded. +fn address_text(session: &Session) -> String { + match session.last_ip.as_deref().or(session.ip.as_deref()) { + Some(ip) => format!(" · {ip}"), + None => String::new(), + } +} + #[component] async fn sessions_view( lang: Lang, @@ -46,8 +65,8 @@ async fn sessions_view( for session in sessions.into_iter() {
  • - (session.user_agent.clone().unwrap_or_else(|| t(lang, Key::UnknownBrowser).into())) - (i18n::dated_label(lang, Key::SignedIn)) " " rel_time(lang: lang, stamp: session.created_at.as_str()) " · " (i18n::dated_label(lang, Key::LastSeen)) " " rel_time(lang: lang, stamp: session.last_seen.as_str()) " · " (i18n::dated_label(lang, Key::ExpiresLabel)) " " rel_time(lang: lang, stamp: session.expires_at.as_str()) + (session_label(lang, &session)) + (i18n::dated_label(lang, Key::SignedIn)) " " rel_time(lang: lang, stamp: session.created_at.as_str()) " · " (i18n::dated_label(lang, Key::LastSeen)) " " rel_time(lang: lang, stamp: session.last_seen.as_str()) " · " (i18n::dated_label(lang, Key::ExpiresLabel)) " " rel_time(lang: lang, stamp: session.expires_at.as_str()) (address_text(&session)) if session.id == current_id { (t(lang, Key::ThisSession)) } @@ -74,6 +93,50 @@ async fn sessions_view( }) } +#[component] +async fn session_detail_view( + lang: Lang, + csrf: &str, + session: Session, + current: bool, +) -> Result { + let user_agent = session + .user_agent + .clone() + .unwrap_or_else(|| t(lang, Key::UnknownBrowser).to_owned()); + let sign_in_ip = session.ip.clone().unwrap_or_else(|| "-".to_owned()); + let last_ip = session.last_ip.clone().unwrap_or_else(|| "-".to_owned()); + let id = session.id.clone(); + Ok(view! { +
    +

    (session_label(lang, &session))

    +
    + if current { +

    (t(lang, Key::ThisSession))

    + } +
    +
    +
    (t(lang, Key::UserAgent))
    (user_agent.as_str())
    +
    (t(lang, Key::SignInIp))
    (sign_in_ip.as_str())
    +
    (t(lang, Key::LastIp))
    (last_ip.as_str())
    +
    (t(lang, Key::SignedIn))
    rel_time(lang: lang, stamp: session.created_at.as_str()) " (" (session.created_at.as_str()) ")"
    +
    (t(lang, Key::LastSeenAt))
    rel_time(lang: lang, stamp: session.last_seen.as_str()) " (" (session.last_seen.as_str()) ")"
    +
    (t(lang, Key::ExpiresAt))
    rel_time(lang: lang, stamp: session.expires_at.as_str()) " (" (session.expires_at.as_str()) ")"
    +
    +
    +
    + if !current { +
    + + + +
    + } +

    (t(lang, Key::BackToSessions))

    +
    + }) +} + #[page("/settings/sessions")] async fn sessions_page(cx: &Cx) -> Result { let viewer = require_user(cx).await?; @@ -89,6 +152,27 @@ async fn sessions_page(cx: &Cx) -> Result { }) } +#[page("/settings/sessions/{id}")] +async fn session_page(cx: &Cx) -> Result { + let viewer = require_user(cx).await?; + let lang = i18n::lang(cx, Some(&viewer.0)); + let id = path_param_segment(cx, "id").to_owned(); + // Only the signed-in user's own sessions are shown; anything else is not found. + let sessions = app_context::(cx) + .store + .list_sessions(&viewer.0.id) + .await?; + let Some(session) = sessions.into_iter().find(|s| s.id == id) else { + return Err(not_found().into()); + }; + let current = session.id == viewer.1.id; + let csrf = viewer.1.csrf_token.clone(); + let title = session_label(lang, &session); + Ok(view! { + shell(title: title.as_str(), viewer: Some(&viewer), session_detail_view(lang: lang, csrf: csrf.as_str(), session: session, current: current)) + }) +} + #[route(POST "/settings/sessions/revoke")] async fn sessions_revoke(cx: &Cx, Form(form): Form) -> Result { let (user, current) = require_csrf(cx, &form.csrf).await?; diff --git a/crates/forge-web/src/test_support.rs b/crates/forge-web/src/test_support.rs index cb3fc1e..e8dd44c 100644 --- a/crates/forge-web/src/test_support.rs +++ b/crates/forge-web/src/test_support.rs @@ -126,6 +126,7 @@ pub async fn create_session(store: &Store, user_id: &str, token: &str, csrf: &st csrf, &stamp_after(Duration::from_secs(3600)), None, + None, ) .await .expect("session"); diff --git a/crates/forge-web/tests/e2e/orgs_core_e2e.rs b/crates/forge-web/tests/e2e/orgs_core_e2e.rs index 943ee6e..35187c5 100644 --- a/crates/forge-web/tests/e2e/orgs_core_e2e.rs +++ b/crates/forge-web/tests/e2e/orgs_core_e2e.rs @@ -106,7 +106,14 @@ async fn seed_org(_dir: PathBuf, store: Store) { .unwrap(); let expiry = forge_core::time::stamp_after(Duration::from_secs(3600)); store - .create_session(&org.id, &hash_token(ORG_SESSION), "csrf", &expiry, None) + .create_session( + &org.id, + &hash_token(ORG_SESSION), + "csrf", + &expiry, + None, + None, + ) .await .unwrap(); store