supertokens-node icon indicating copy to clipboard operation
supertokens-node copied to clipboard

Allow mergeIntoAccessTokenPayload to take an extra option to allow for null

Open rishabhpoddar opened this issue 3 years ago • 0 comments

Right now, if a user wants to intentionally update the access token payload to add null to it, calling mergeIntoAccessTokenPayload won't allow that since it treats null as deletions.

For that case, we can allow a user to do this by adding a second argument to the funciton:

mergeIntoAccessTokenPayload(payloadUpdate, nullIsDelete: boolean = true) 

And if the nullIsDelete is false, then nulls will be sent to the core as is.

rishabhpoddar avatar Sep 01 '22 14:09 rishabhpoddar