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

Sessions restoring #489

Open
axbuglak opened this issue Jan 25, 2024 · 1 comment
Open

Sessions restoring #489

axbuglak opened this issue Jan 25, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@axbuglak
Copy link

axbuglak commented Jan 25, 2024

Describe the bug

Sessions don't restore automatically on http request. Logic for this is commented in the transport.js . As discussed on the call, this is due to the fact that transport.js previously had access to the client, but now it has been changed and therefore it is simply commented out, and nothing new has been written to do automatically sessions restoring. Instead, this logic is implemented in the files like auth/provider.js/restoreSession or auth/restore.js in business logic, but metacom.d.ts also doest have restore method, so Its like a small conflict.
I think it should happen automatically in init() function on this.httpServer.on('request') in server.js, but the main problem that we need to read session from db when our session store doest have received session token. So in this case the best option, in my opinion, will be just to call method readSession from client duo this.application.getMethod('auth', '*', 'restore') or something like this.
So to make the long story short, we need add restore method to metacom.d.ts and leave the logic for session restoring to the client. Or make it on http request as explained in the last paragraph.

To Reproduce

Just try to send a request for private method without restoring session manual.

Expected behavior

Restoring will happen automatically when I send a request with session in cookies

Desktop (please complete the following information):

  • OS: macOs Sonoma 14.2.1
  • Node.js version 20
@axbuglak axbuglak added the bug Something isn't working label Jan 25, 2024
@axbuglak
Copy link
Author

I can also write a pull request for it, just how I see it must works

@axbuglak axbuglak mentioned this issue Feb 15, 2024
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant