pub enum OAuth2Mode {
AddToUser,
CreateUser,
Login,
CreateUserOrLogin,
}
Expand description
Mode of OAuth2 operation to explicitly indicate user intent.
This enum defines the available modes for OAuth2 authentication, determining the behavior when a user authenticates with an OAuth2 provider.
Variants§
AddToUser
Add an OAuth2 account to an existing user.
This mode is used when an authenticated user wants to link an additional OAuth2 provider account to their existing account.
CreateUser
Create a new user account from the OAuth2 provider data.
This mode is used specifically for new user registration using OAuth2.
Login
Login with an existing OAuth2 account.
This mode is used when a user wants to authenticate using a previously linked OAuth2 provider account.
CreateUserOrLogin
Create a new user if no matching account exists, otherwise login.
This flexible mode attempts to login with an existing account if one matches the OAuth2 provider data, or creates a new user account if none is found.
Implementations§
Source§impl OAuth2Mode
impl OAuth2Mode
Trait Implementations§
Source§impl Clone for OAuth2Mode
impl Clone for OAuth2Mode
Source§fn clone(&self) -> OAuth2Mode
fn clone(&self) -> OAuth2Mode
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for OAuth2Mode
impl Debug for OAuth2Mode
Source§impl<'de> Deserialize<'de> for OAuth2Mode
impl<'de> Deserialize<'de> for OAuth2Mode
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl FromStr for OAuth2Mode
impl FromStr for OAuth2Mode
Source§impl PartialEq for OAuth2Mode
impl PartialEq for OAuth2Mode
Source§impl Serialize for OAuth2Mode
impl Serialize for OAuth2Mode
impl Eq for OAuth2Mode
impl StructuralPartialEq for OAuth2Mode
Auto Trait Implementations§
impl Freeze for OAuth2Mode
impl RefUnwindSafe for OAuth2Mode
impl Send for OAuth2Mode
impl Sync for OAuth2Mode
impl Unpin for OAuth2Mode
impl UnwindSafe for OAuth2Mode
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more