I have a function when a user signs up it assigns them a TUID. If the user is on the same team as another user it assigns them the same TUID value. However my value is getting duplicated instead of assigning the user the same TUID value.
Am wondering how I would go about fixing this as my apps team based functionality is synced through this TUID being the same for each user but truly the same not a duplicate
I misunderstood you.
Your goal is that TUID is always unique? Or you want to have 1 TUID code matching 2 elements as a single item? Meaning 2 elements can have 1 but they refer the one and the same?
TUID is a unique value that I generate for each new user that pays a subscription. However a new user that is invited by the user that is subscribed will be a team member making them have the same TUID as the subscribed user. So TUID will be generated randomly for subscribed users and shared for that users team.
I have the theory of this working but its not assigning the user the same TUID its duplicating the TUID instead of assigning it the same TUID.