Unify the old session and the next auth session #104

Closed
opened 2026-05-29 13:51:33 +00:00 by pdmnyberg · 2 comments
pdmnyberg commented 2026-05-29 13:51:33 +00:00 (Migrated from github.com)

The current solution uses two sessions. One from the library of next auth and one based on the structure of the initial session implementation. In order to reduce the maintenance burden we should try to unify these two sessions so that they are managed by next auth.

Acceptance criteria:

  • We can update the next auth session with protected (encrypted) data that is needed on server side
  • We can include all the data needed for a user session in the next auth session
The current solution uses two sessions. One from the library of next auth and one based on the structure of the initial session implementation. In order to reduce the maintenance burden we should try to unify these two sessions so that they are managed by next auth. Acceptance criteria: - [ ] We can update the next auth session with protected (encrypted) data that is needed on server side - [ ] We can include all the data needed for a user session in the next auth session
aaperis commented 2026-08-17 08:21:05 +00:00 (Migrated from github.com)

Note: The current issue could also close #146 since logout logic should be unified as well.

Note: The current issue could also close #146 since logout logic should be unified as well.
pdmnyberg commented 2026-08-20 11:28:14 +00:00 (Migrated from github.com)

I started working here: https://github.com/NBISweden/sda-download-ui/tree/104-unify-next-auth-session

The work is clearly unfinished but works under the assumption that the most next and next-auth native solution to this problem would be to mirror the REST API using the session instead of a token. I had a hard time figuring out what else would be a nice solution to the problem so feel free to doubt my choice and go another route if you find it more convenient or clearly better.

I would appreciate if I could be relieved of this task as this moment in time due to being slightly incapacitated.

I started working here: https://github.com/NBISweden/sda-download-ui/tree/104-unify-next-auth-session The work is clearly unfinished but works under the assumption that the most next and next-auth native solution to this problem would be to mirror the REST API using the session instead of a token. I had a hard time figuring out what else would be a nice solution to the problem so feel free to doubt my choice and go another route if you find it more convenient or clearly better. I would appreciate if I could be relieved of this task as this moment in time due to being slightly incapacitated.
Sign in to join this conversation.
No description provided.