feat: add auth middleware chain with ctx resolver and cookie parsing
This commit is contained in:
@@ -6,7 +6,7 @@ use serde::Deserialize;
|
||||
use serde_json::{Value, json};
|
||||
use tower_cookies::{Cookie, Cookies};
|
||||
|
||||
use crate::error::LoftError;
|
||||
use crate::{error::LoftError, web::AUTH_TOKEN};
|
||||
|
||||
pub fn routes_login() -> Router {
|
||||
Router::new()
|
||||
@@ -24,7 +24,7 @@ async fn login(
|
||||
}
|
||||
|
||||
// FIXME: real auth-token generation-signature
|
||||
cookies.add(Cookie::new("auth-token", "user-1.exp.sign"));
|
||||
cookies.add(Cookie::new(AUTH_TOKEN, "user-1.exp.sign"));
|
||||
|
||||
let body = Json(json!({
|
||||
"result": {
|
||||
|
||||
Reference in New Issue
Block a user