Manually provide the session token/JWT to authenticate user #11221
InimicalPart
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Goals
Non-Goals
No response
Background
I came up with this idea while working with Auth.js and next-ws. next-ws is not officially supported by Auth,js but if this idea would come to life, it could allow users to be authenticated through for example websockets. This would be done by grabbing the sent over cookie information, which for this example is accessible through next-ws, and feed the token from the authjs.session-token cookie to a function in Auth.js. This would then convert that session token into a fully fletched session that the developer can use. As far as I am aware, there is no way to accomplish this as of right now, and I think this could benefit a lot of developers.
While I haven't played around too much with Auth.js when it comes to JWT, I think this feature would also work for that.
Proposal
I think the best way to implement this feature would be to pass the token to the
auth()
function, where it then would return a session for the developer to use, but more ideas are welcome!Beta Was this translation helpful? Give feedback.
All reactions