pub struct CreateOAuth;
Expand description
Sign in via oauth.
Note: If the account doesn’t exist, but the oauth token is valid, it’ll return a token that can be used to create an account.
§Errors
(non exhaustive list)
If there is already a user with the oauth user’s email,
and it isn’t them - 409 - Conflict
§Flow (login)
GET /v1/session/oauth/url/{service}/{kind}
POST /v1/session/oauth
(this route) with the token
§Flow (register)
GET /v1/session/oauth/url/{service}/{kind}
- Returns the access token as a cookie + csrf token, in addition to any user profile info given by the OAuth provider.
POST /v1/session/oauth
(this route) with the tokenPOST /v1/user/me/profile
- Optionally include the user profile information returned in #1
Trait Implementations§
Source§impl ApiEndpoint for CreateOAuth
impl ApiEndpoint for CreateOAuth
Source§type Path = CreateSessionOAuthPath
type Path = CreateSessionOAuthPath
The path type for this endpoint.
Source§type Req = CreateSessionOAuthRequest
type Req = CreateSessionOAuthRequest
The request type for this endpoint.
Source§type Res = CreateSessionResponse
type Res = CreateSessionResponse
The response type for this endpoint.
Source§type Err = EmptyError
type Err = EmptyError
The (inner) error type for this endpoint.
Auto Trait Implementations§
impl Freeze for CreateOAuth
impl RefUnwindSafe for CreateOAuth
impl Send for CreateOAuth
impl Sync for CreateOAuth
impl Unpin for CreateOAuth
impl UnwindSafe for CreateOAuth
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