Httponly Cookie
#1425
Replies: 1 comment
-
Okay.. We can use the existing logic, #[debug_handler]
async fn current(auth: auth::JWT, State(ctx): State<AppContext>) -> Result<Response> {
tracing::info!("current user {:?}", auth);
let user = users::Model::find_by_pid(&ctx.db, &auth.claims.pid).await?;
format::json(CurrentResponse::new(&user))
} just need to update configuration.yml auth:
...
jwt:
location:
from: Cookie
name: auth_token |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Is there a reason why we are not using httponly cookie?
this is my sample code
But problem is, what would be the correct way to validate the cookie?
the current way used in loco can't seem to swap to a cookie based authentication
Beta Was this translation helpful? Give feedback.
All reactions