[][src]Trait rocket_oauth2::Callback

pub trait Callback: Send + Sync + 'static {
    type Responder: Responder<'static>;
    fn callback(
        &self,
        request: &Request,
        token: TokenResponse
    ) -> Self::Responder; }

An OAuth2 Callback implements application-specific OAuth client logic, such as setting login cookies and making database and API requests. It is tied to a specific Adapter, and will recieve an instance of the Adapter's Token type.

Associated Types

type Responder: Responder<'static>

The callback Responder type.

Loading content...

Required methods

fn callback(&self, request: &Request, token: TokenResponse) -> Self::Responder

This method will be called when a token exchange has successfully completed and will be provided with the request and the token. Implementors should perform application-specific logic here, such as checking a database or setting a login cookie.

Loading content...

Implementors

impl<F, R> Callback for F where
    F: Fn(&Request, TokenResponse) -> R + Send + Sync + 'static,
    R: Responder<'static>, 
[src]

type Responder = R

Loading content...