Skip to content

Latest commit

 

History

History
37 lines (21 loc) · 1.22 KB

updateTokenAttributesById.md

File metadata and controls

37 lines (21 loc) · 1.22 KB

elections-cpl.api.hscc.bdpa.orgDocs


elections-cpl.api.hscc.bdpa.org / lib/next-auth/token / updateTokenAttributesById

Function: updateTokenAttributesById()

updateTokenAttributesById(__namedParameters): Promise<number>

Updates a token's attributes by matching the provided data against the well-known "auth" MongoDB collection. Throws on invalid/missing target or entry data.

Note that the new attributes object will patch, not replace, the old object.

Parameters

__namedParameters

__namedParameters.auth_id: undefined | string | ObjectId

The ObjectId of the token in the well-known "auth" MongoDb collection. Throws if auth_id cannot be coerced into an ObjectId.

__namedParameters.update: LiteralUnknownUnion<TokenAttributes>

The object used to patch the token's attributes.

Returns

Promise<number>

Source

lib/next-auth/token.ts:553