1
0
mirror of https://github.com/actix/examples synced 2025-06-28 18:00:37 +02:00

upgrade to alpha.6

This commit is contained in:
Nikolay Kim
2019-04-14 10:34:41 -07:00
parent 8fb2bf6869
commit 09b0188ff9
13 changed files with 93 additions and 117 deletions

View File

@ -46,11 +46,12 @@ impl Handler<AuthData> for DbExecutor {
// simple aliasing makes the intentions clear and its more readable
pub type LoggedUser = SlimUser;
impl<P> FromRequest<P> for LoggedUser {
impl FromRequest for LoggedUser {
type Config = ();
type Error = Error;
type Future = Result<LoggedUser, Error>;
fn from_request(req: &HttpRequest, pl: &mut Payload<P>) -> Self::Future {
fn from_request(req: &HttpRequest, pl: &mut Payload) -> Self::Future {
if let Some(identity) = Identity::from_request(req, pl)?.identity() {
let user: SlimUser = decode_token(&identity)?;
return Ok(user as LoggedUser);