MCPcopy Create free account
hub / github.com/adcontextprotocol/adcp / get_session

Function get_session

apps/desktop/src-tauri/src/auth.rs:132–141  ·  view source on GitHub ↗

Get session from file

()

Source from the content-addressed store, hash-verified

130
131/// Get session from file
132pub fn get_session() -> Result<Option<UserSession>, Box<dyn std::error::Error>> {
133 let path = get_session_file_path();
134 if path.exists() {
135 let json = std::fs::read_to_string(&path)?;
136 let session: UserSession = serde_json::from_str(&json)?;
137 println!("Session loaded from file");
138 return Ok(Some(session));
139 }
140 Ok(None)
141}
142
143/// Clear session from both keychain and file
144pub fn clear_session() -> Result<(), Box<dyn std::error::Error>> {

Callers 2

get_auth_stateFunction · 0.85
get_session_tokenFunction · 0.85

Calls 2

get_session_file_pathFunction · 0.85
existsMethod · 0.80

Tested by

no test coverage detected