You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
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 thattransport.js
previously had access to theclient
, 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 likeauth/provider.js/restoreSession
orauth/restore.js
in business logic, but metacom.d.ts also doest haverestore
method, so Its like a small conflict.I think it should happen automatically in
init()
function onthis.httpServer.on('request')
inserver.js
, but the main problem that we need to read session from db when oursession store
doest have received session token. So in this case the best option, in my opinion, will be just to call methodreadSession
from client duothis.application.getMethod('auth', '*', 'restore')
or something like this.So to make the long story short, we need add
restore
method tometacom.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):
The text was updated successfully, but these errors were encountered: