-
Hello, i'm trying to implement an authentication flow, in that moment i'm coding a cookie refresh middleware in v4.9 and with using // other services
.wrap_fn(move |req, srv| {
let auth_cookie_name = match env::var("AUTH_COOKIE_NAME") {
Ok(name) => name,
Err(_) => "auth_cookie".to_string()
};
let cookie = req.cookie(&auth_cookie_name);
let fut = srv.call(req);
async move {
let mut res = fut.await?;
res = utils::refresh_cookies(cookie, auth_cookie_name, res).await.unwrap();
Ok(res)
}
}) so i think in next version you should make public the second argument of the inner closure of .wrap() method. |
Beta Was this translation helpful? Give feedback.
Answered by
robjtede
Oct 28, 2024
Replies: 1 comment
Answer selected by
Necoo33
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
see: