Trait bellhop::auth::Auth

source ·
pub trait Auth: Debug {
    fn authenticate(
        &self,
        _conn: &Db<'_>,
        _req: &Request<'_>
    ) -> Result<Option<User>, Error>; fn prelaunch(&self, rocket: Rocket) -> Rocket { ... } }
Expand description

Trait for plugins that provide authentication.

See module documentation for more information.

Required Methods§

Return the [models::user::User] that is authenticated in the given Request.

A return value of Ok(None) means that there is no authenticated user according to this plugin. Authentication will be retried with the next plugin.

On the other hand, a return value of Err(...) will abort the process, and no user authentication will be retried.

Provided Methods§

Perform Rocket related setup, like attaching routes and fairings, reading configuration values, etc.

Implementors§