slack status without the slack status.zzstoatzz.io/
quickslice

Fix OAuth login issues for self-hosted PDS

- Fix SqliteStateStore and SqliteSessionStore to return Ok(None) instead of error when no state/session exists
- Add missing OAuth scopes to localhost configuration (profile and follows access)
- Remove unused NoSessionFound error variant

This fixes the OAuth flow failing when using a self-hosted PDS by ensuring the state stores properly handle missing entries and the localhost config declares all required scopes.

Changed files
+11 -4
src
+9
src/main.rs
··· 156 156 // Using granular scope for status records only 157 157 // This replaces TransitionGeneric with specific permissions 158 158 Scope::Unknown("repo:io.zzstoatzz.status.record".to_string()), 159 + // Need to read profiles for the feed page 160 + Scope::Unknown( 161 + "rpc:app.bsky.actor.getProfile?aud=did:web:api.bsky.app#bsky_appview" 162 + .to_string(), 163 + ), 164 + // Need to read following list for following feed 165 + Scope::Unknown( 166 + "rpc:app.bsky.graph.getFollows?aud=did:web:api.bsky.app".to_string(), 167 + ), 159 168 ]), 160 169 }, 161 170 keys: None,
+2 -4
src/storage.rs
··· 16 16 pub enum SqliteStoreError { 17 17 #[error("Invalid session")] 18 18 InvalidSession, 19 - #[error("No session found")] 20 - NoSessionFound, 21 19 #[error("Database error: {0}")] 22 20 DatabaseError(async_sqlite::Error), 23 21 } ··· 49 47 .map_err(|_| SqliteStoreError::InvalidSession)?; 50 48 Ok(Some(deserialized_session)) 51 49 } 52 - Ok(None) => Err(SqliteStoreError::NoSessionFound), 50 + Ok(None) => Ok(None), 53 51 Err(db_error) => { 54 52 log::error!("Database error: {db_error}"); 55 53 Err(SqliteStoreError::DatabaseError(db_error)) ··· 110 108 .map_err(|_| SqliteStoreError::InvalidSession)?; 111 109 Ok(Some(deserialized_state)) 112 110 } 113 - Ok(None) => Err(SqliteStoreError::NoSessionFound), 111 + Ok(None) => Ok(None), 114 112 Err(db_error) => { 115 113 log::error!("Database error: {db_error}"); 116 114 Err(SqliteStoreError::DatabaseError(db_error))