pub trait OAuthStateBackend: Send + Sync {
// Required methods
fn put(&self, token: &str, state: &OAuthState);
fn take(&self, token: &str, now_unix_secs: u64) -> Option<OAuthState>;
}Expand description
Backing store for OAuth state records. Default impl keeps them in memory (fine for tests + dev); the runtime swaps in a SQLite or Postgres backend so a restart in the middle of an OAuth handshake doesn’t leave the user with “invalid state” on the callback.
Required Methods§
Sourcefn put(&self, token: &str, state: &OAuthState)
fn put(&self, token: &str, state: &OAuthState)
Persist a state record under token.