maxcountryman / axum-login

🪪 User identification, authentication, and authorization for Axum.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Tag session record with user ID

ryanmcgrath opened this issue · comments

Thanks for building and iterating on this crate - it definitely hits a lot of pain points and it's a breath of fresh air to see something so well thought out and designed.

One thing I found myself reaching for was a way to tag a row in the sessions table as belonging to a user (specified by an ID). The general idea here is that I was looking to show a list of active sessions in a view, but when I looked at the table, there doesn't appear to be a way to query for "sessions owned by current user".

At a glance, this seems like something that'd require changes to tower-sessions as well as axum-login - but I'm curious if there's any prior work or thoughts in this realm that I might have missed. I can work around it at the moment by just operating a second table and syncing up the delete(s), but it's admittedly more scattered than I'd like to have.