oneshot_oauth2_callback/response.rs
1use oauth2::{AuthorizationCode, CsrfToken};
2use serde::Deserialize;
3
4pub use oauth2::basic::BasicErrorResponse;
5
6/// Represents the parameters in the redirect url, when fetched in the browser.
7#[derive(Deserialize)]
8pub struct CodeGrantResponse {
9 /// Code used to perform token exchange.
10 pub code: AuthorizationCode,
11 /// State from the grant request. Must be verified by the caller.
12 pub state: CsrfToken,
13}
14
15/// The authorization server may send us a well defined success or error.
16pub type CodeGrantResult = Result<CodeGrantResponse, BasicErrorResponse>;