Closed alex-all3dp closed 1 year ago
Hello Alex,
Thank you for bringing this issue to our attention. We're happy to inform you that the issue you reported has been fixed in version 1.0.2 of @nestjs-cognito/auth
npm package. The updated version now handles both cognito:username
and username
attributes in the JWT payload, allowing for more flexible authentication.
Could you please confirm if the updated version has resolved the issue for you? If everything is working correctly, we will go ahead and close this issue.
Thank you for your help in improving our solution.
@Lokicoule Thanks for the quick fix, it works nicely! :)
I receive the following error when adding the
Authentication()
decorator to my controller:The JWT payload is:
It appears that you check for
cognito:username
only, which may be a custom attribute? Could you extend this check to use eithercognito:username
orusername
, depending on which one is present on the payload?https://github.com/Lokicoule/nestjs-cognito/blob/b1dde65e682e38a3555dee7a1b0517ba94652287/packages/auth/lib/user/user.mapper.ts#L12