Question 💬
I'd like to capture browser, last accessed and IP info when a database session is created or accessed. (Think gmail's "Last account activity" section)
In the future it would be nice to be able to invalidate sessions when I detect things change (say maybe the country changes?) or stop logins if you login from two countries at the same time. But what I need help with is;
- I can update a database session's last accessed manually in the session callback (I don't have adapter access but I can make a global one), but I can't return null and log someone out.
- I don't have access to any request information in
createSession() in my adapter or session() in the nextauth callback. So I can't grab ip addresses or User-Agent headers.
Are there better approaches? Am I asking for new features?
How to reproduce ☕️
Nothing to reproduce, I'm either asking for api changes or ways to work around the issue.
Contributing 🙌🏽
Yes, I am willing to help answer this question in a PR
Question 💬
I'd like to capture browser, last accessed and IP info when a database session is created or accessed. (Think gmail's "Last account activity" section)
In the future it would be nice to be able to invalidate sessions when I detect things change (say maybe the country changes?) or stop logins if you login from two countries at the same time. But what I need help with is;
createSession()in my adapter orsession()in the nextauth callback. So I can't grab ip addresses orUser-Agentheaders.Are there better approaches? Am I asking for new features?
How to reproduce ☕️
Nothing to reproduce, I'm either asking for api changes or ways to work around the issue.
Contributing 🙌🏽
Yes, I am willing to help answer this question in a PR