pub struct OAuthProvider {
pub client_id: String,
pub client_secret: String,
pub auth_url: String,
pub token_url: String,
pub user_info_url: String,
pub scopes: Vec<String>,
pub map_user_info: fn(Value) -> Result<OAuthUserInfo, String>,
}Expand description
Configuration for a single OAuth provider.
Fields§
§client_id: String§client_secret: String§auth_url: String§token_url: String§user_info_url: String§scopes: Vec<String>§map_user_info: fn(Value) -> Result<OAuthUserInfo, String>Implementations§
Source§impl OAuthProvider
impl OAuthProvider
pub fn google(client_id: &str, client_secret: &str) -> OAuthProvider
pub fn github(client_id: &str, client_secret: &str) -> OAuthProvider
pub fn discord(client_id: &str, client_secret: &str) -> OAuthProvider
Trait Implementations§
Source§impl Clone for OAuthProvider
impl Clone for OAuthProvider
Source§fn clone(&self) -> OAuthProvider
fn clone(&self) -> OAuthProvider
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for OAuthProvider
impl RefUnwindSafe for OAuthProvider
impl Send for OAuthProvider
impl Sync for OAuthProvider
impl Unpin for OAuthProvider
impl UnsafeUnpin for OAuthProvider
impl UnwindSafe for OAuthProvider
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more