pub struct OAuthState {
pub provider: String,
pub callback_url: String,
pub error_callback_url: String,
pub pkce_verifier: Option<String>,
pub expires_at: u64,
}Expand description
One stored OAuth state record. Carries the post-callback redirect
URLs alongside the provider so the callback handler doesn’t need to
consult an env var to know where to send the user. Both URLs are
validated against PYLON_TRUSTED_ORIGINS at create time, so the
callback can trust them without re-checking.
Fields§
§provider: String§callback_url: StringURL the callback redirects to on success. The frontend supplies
this via ?callback= on the start request.
error_callback_url: StringURL the callback redirects to on failure. Defaults to
callback_url when the frontend doesn’t pass an explicit
?error_callback=. The error code + message ride along as
query params (?oauth_error=X&oauth_error_message=Y).
pkce_verifier: Option<String>PKCE code_verifier when the provider requires PKCE. Set by the
/api/auth/login/<provider> start route via
OAuthConfig::auth_url_with_pkce; replayed on token exchange
in the callback. None for non-PKCE providers.
expires_at: u64Trait Implementations§
Source§impl Clone for OAuthState
impl Clone for OAuthState
Source§fn clone(&self) -> OAuthState
fn clone(&self) -> OAuthState
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more