mirror of
https://github.com/actix/examples
synced 2025-06-26 17:17:42 +02:00
update actix-web-lab dep
This commit is contained in:
@ -6,7 +6,6 @@ use actix_web::{
|
||||
http::StatusCode,
|
||||
middleware, web, App, HttpMessage as _, HttpRequest, HttpServer, Responder,
|
||||
};
|
||||
use actix_web_lab::web::Redirect;
|
||||
|
||||
const ONE_MINUTE: Duration = Duration::minutes(1);
|
||||
|
||||
@ -23,13 +22,13 @@ async fn index(identity: Option<Identity>) -> actix_web::Result<impl Responder>
|
||||
async fn login(req: HttpRequest) -> impl Responder {
|
||||
Identity::login(&req.extensions(), "user1".to_owned()).unwrap();
|
||||
|
||||
Redirect::to("/").using_status_code(StatusCode::FOUND)
|
||||
web::Redirect::to("/").using_status_code(StatusCode::FOUND)
|
||||
}
|
||||
|
||||
async fn logout(id: Identity) -> impl Responder {
|
||||
id.logout();
|
||||
|
||||
Redirect::to("/").using_status_code(StatusCode::FOUND)
|
||||
web::Redirect::to("/").using_status_code(StatusCode::FOUND)
|
||||
}
|
||||
|
||||
#[actix_web::main]
|
||||
|
Reference in New Issue
Block a user