Skip to content
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

Idea: Rework session service implementation to use the new axum 0.6 state pattern #16

Closed
maxcountryman opened this issue Nov 25, 2022 · 3 comments
Labels
help wanted Extra attention is needed

Comments

@maxcountryman
Copy link
Owner

As mentioned here and explained in more detail here.

@maxcountryman maxcountryman added the help wanted Extra attention is needed label Nov 25, 2022
@Ptrskay3
Copy link
Contributor

Correct me if I'm wrong, but State is for global application resources, which is the same for all requests, such as database pools or email clients. On the other hand though, the session we add as an extension to the request is local, and differ from request to request.

@maxcountryman
Copy link
Owner Author

Yes, I think you are right. (It's a bit confusing how the new middleware docs mention state now.)

That said, while this has no practical bearing on things (it does not provide additional type safety, for example), I did reorganize the axum-login middleware a bit.

We could potentially do something similar here but again I don't think it makes much of a difference in practice.

@maxcountryman
Copy link
Owner Author

Closing this for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants