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
, the function is named as a get-only function (i.e. pure), but in fact it mutates the server state, generate and records a JWT token at the server (via jwtService.signAsync). The name should be updated to reflect that, e.g. create...
, a new token is generated using returned userData with a few JWT fields deleted. This can be potentially inconsistent with the payload given in other places, such as
Function doesn't make any mutations on the server side. signAsync creates object in memory and return the resulted object (accessToken / refreshToken).
Generated tokens are not stored anyware on the backend side and are passed directly to the client
It is very unlikely that these properties will be excluded or renamed.
About the payload - it's the dev responsibility; if you are adding new fields to JWT you have to understand how it works and check the specification at least once.
Current PumpOne JWT structure:
A solution can be to wrap the user payload (username, etc) into additional property, but it would result in a slight increase of JWT token size.
Considering all of this, I prefer to leave it as it is, but it's discussible of course! Thanks for pointing it
In
pump.fun.backend/src/user/user.service.ts
Line 72 in ab2b9d9
jwtService.signAsync
). The name should be updated to reflect that, e.g.create...
In
pump.fun.backend/src/user/user.controller.ts
Line 150 in ab2b9d9
userData
with a few JWT fields deleted. This can be potentially inconsistent with the payload given in other places, such aspump.fun.backend/src/user/user.controller.ts
Line 107 in ab2b9d9
The text was updated successfully, but these errors were encountered: