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

upgrade to alpha4

This commit is contained in:
Nikolay Kim
2019-04-07 23:39:45 -07:00
parent 86e0f3e02c
commit 815e34f32d
34 changed files with 97 additions and 72 deletions

View File

@ -8,8 +8,8 @@ workspace = ".."
[dependencies]
actix = { version = "0.8.0-alpha.2", features = ["http"] }
actix-rt = "0.2.2"
actix-web = "1.0.0-alpha.3"
actix-files = "0.1.0-alpha.2"
actix-web = "1.0.0-alpha.4"
actix-files = "0.1.0-alpha.4"
bcrypt = "0.2.1"
chrono = { version = "0.4.6", features = ["serde"] }

View File

@ -1,6 +1,6 @@
use actix::{Handler, Message};
use actix_web::{dev::ServiceFromRequest, Error};
use actix_web::{middleware::identity::Identity, FromRequest, HttpRequest};
use actix_web::{dev::Payload, Error, HttpRequest};
use actix_web::{middleware::identity::Identity, FromRequest};
use bcrypt::verify;
use diesel::prelude::*;
@ -50,8 +50,8 @@ impl<P> FromRequest<P> for LoggedUser {
type Error = Error;
type Future = Result<LoggedUser, Error>;
fn from_request(req: &mut ServiceFromRequest<P>) -> Self::Future {
if let Some(identity) = Identity::from_request(req)?.identity() {
fn from_request(req: &HttpRequest, pl: &mut Payload<P>) -> Self::Future {
if let Some(identity) = Identity::from_request(req, pl)?.identity() {
let user: SlimUser = decode_token(&identity)?;
return Ok(user as LoggedUser);
}