Hey all! I have a login flow that creates an auth token (ttl: 5 minutes) for a user document stored in a User collection.
If I execute the flow sequentially (or from two separate machines), does it create two valid tokens on the User document? Or, does the first token get overwritten?
Multiple tokens can exist for a particular identity. This feature could be used to provide identity-based access on multiple devices at once.
I noticed this in the tokens documentation, does this mean that by default, creating another token on a document doesn’t overwrite previously written tokens?
does it create two valid tokens on the User document? Or, does the first token get overwritten?
Each Login call creates a new token. Similarly, when you create token documents directly, no existing tokens are removed.
You can create an index on the Tokens collection with the instance field defined as a term. That would let you search for all existing tokens associated with an identity document. You could use those search results to apply a token management policy.
does this mean that by default, creating another token on a document doesn’t overwrite previously written tokens?