pub struct OAuthPlugin { /* private fields */ }Expand description
OAuth authentication plugin for social sign-in
Implementations§
Source§impl OAuthPlugin
impl OAuthPlugin
pub fn new() -> OAuthPlugin
pub fn with_config(config: OAuthConfig) -> OAuthPlugin
pub fn add_provider(self, name: &str, provider: OAuthProvider) -> OAuthPlugin
Trait Implementations§
Source§impl<DB> AuthPlugin<DB> for OAuthPluginwhere
DB: DatabaseAdapter,
impl<DB> AuthPlugin<DB> for OAuthPluginwhere
DB: DatabaseAdapter,
Source§fn on_request<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
req: &'life1 AuthRequest,
ctx: &'life2 AuthContext<DB>,
) -> Pin<Box<dyn Future<Output = Result<Option<AuthResponse>, AuthError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
OAuthPlugin: 'async_trait,
fn on_request<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
req: &'life1 AuthRequest,
ctx: &'life2 AuthContext<DB>,
) -> Pin<Box<dyn Future<Output = Result<Option<AuthResponse>, AuthError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
OAuthPlugin: 'async_trait,
Called for each request - return Some(response) to handle, None to pass through
Source§fn on_init<'life0, 'life1, 'async_trait>(
&'life0 self,
ctx: &'life1 mut AuthContext<DB>,
) -> Pin<Box<dyn Future<Output = Result<(), AuthError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn on_init<'life0, 'life1, 'async_trait>(
&'life0 self,
ctx: &'life1 mut AuthContext<DB>,
) -> Pin<Box<dyn Future<Output = Result<(), AuthError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Called when the plugin is initialized
Source§fn on_user_created<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
user: &'life1 <DB as DatabaseAdapter>::User,
ctx: &'life2 AuthContext<DB>,
) -> Pin<Box<dyn Future<Output = Result<(), AuthError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
fn on_user_created<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
user: &'life1 <DB as DatabaseAdapter>::User,
ctx: &'life2 AuthContext<DB>,
) -> Pin<Box<dyn Future<Output = Result<(), AuthError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
Called after a user is created
Source§fn on_session_created<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
session: &'life1 <DB as DatabaseAdapter>::Session,
ctx: &'life2 AuthContext<DB>,
) -> Pin<Box<dyn Future<Output = Result<(), AuthError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
fn on_session_created<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
session: &'life1 <DB as DatabaseAdapter>::Session,
ctx: &'life2 AuthContext<DB>,
) -> Pin<Box<dyn Future<Output = Result<(), AuthError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
Called after a session is created
Source§fn on_user_deleted<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
user_id: &'life1 str,
ctx: &'life2 AuthContext<DB>,
) -> Pin<Box<dyn Future<Output = Result<(), AuthError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
fn on_user_deleted<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
user_id: &'life1 str,
ctx: &'life2 AuthContext<DB>,
) -> Pin<Box<dyn Future<Output = Result<(), AuthError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
Called before a user is deleted
Source§fn on_session_deleted<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
session_token: &'life1 str,
ctx: &'life2 AuthContext<DB>,
) -> Pin<Box<dyn Future<Output = Result<(), AuthError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
fn on_session_deleted<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
session_token: &'life1 str,
ctx: &'life2 AuthContext<DB>,
) -> Pin<Box<dyn Future<Output = Result<(), AuthError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
Called before a session is deleted
Source§impl Default for OAuthPlugin
impl Default for OAuthPlugin
Source§fn default() -> OAuthPlugin
fn default() -> OAuthPlugin
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for OAuthPlugin
impl RefUnwindSafe for OAuthPlugin
impl Send for OAuthPlugin
impl Sync for OAuthPlugin
impl Unpin for OAuthPlugin
impl UnwindSafe for OAuthPlugin
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