Skip to content

Remove current_user middleware in favor accessing cookie in authenticate #2651

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jsha opened this issue Jul 21, 2020 · 0 comments · Fixed by #3280
Closed

Remove current_user middleware in favor accessing cookie in authenticate #2651

jsha opened this issue Jul 21, 2020 · 0 comments · Fixed by #3280
Labels
C-internal 🔧 Category: Nonessential work that would make the codebase more consistent or clear

Comments

@jsha
Copy link
Contributor

jsha commented Jul 21, 2020

In #2077, a middleware was introduced to capture a cookie value from the session. The documentation for that says:

The call to conduit_cookie::RequestSession::session needs mutable access to the request and its extensions, and there is no read-only alternative in conduit_cookie to access the session cookie.

At the time that was merged, the conduit-cookie dependency was on 0.8.5. However, in the latest 0.9.4-alpha.4 (already in use by crates.io), there is a read-only accessor for session. So it should now be possible to remove the middleware and access the cookie directly in the authenticate function.

@Turbo87 Turbo87 added the C-internal 🔧 Category: Nonessential work that would make the codebase more consistent or clear label Feb 11, 2021
@bors bors closed this as completed in 322ebf4 Feb 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-internal 🔧 Category: Nonessential work that would make the codebase more consistent or clear
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants