In
|
async getTokens(payload: object) { |
, 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...
In
|
const userData = this.jwtService.verify(body.token); |
, 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
|
const jwt = await this.userService.getTokens(payload) |
. It could lead to error if new fields are added later one, or if library updates and assigns new fields to the payload
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
userDatawith 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