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
I am specifying a constant (user) for the sessionKey of Authenticator.
When I try to retrieve authenticator.sessionKey, it gets rounded to a string, and I can't get the detailed type information.
constsession=awaitgetSession(request.headers.get("Cookie"));// ↓ TS2345: Argument of type string is not assignable to parameter of type "user"session.set(authenticator.sessionKey,user);// Using 'as' would prevent errors, but...session.set(authenticator.sessionKeyas"user",user);
I think it might be possible to achieve this by holding the configuration values in Generics, similar to User.
I would like to know if there are any needs or implementation difficulties for this idea.
If there are any points where the implementation approach is fundamentally wrong, please let me know.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I am specifying a constant (
user
) for thesessionKey
ofAuthenticator
.When I try to retrieve
authenticator.sessionKey
, it gets rounded to a string, and I can't get the detailed type information.I want to specify
authenticator.sessionKey
as thesessionKey
when callingsession.set
, as shown below.I think it might be possible to achieve this by holding the configuration values in Generics, similar to User.
I would like to know if there are any needs or implementation difficulties for this idea.
If there are any points where the implementation approach is fundamentally wrong, please let me know.
Beta Was this translation helpful? Give feedback.
All reactions