Rank 2: Process
Hey, is it possible to initially set the preferences of a user without being logged in, i.e. after an account as been created?
Votes
0
Replies
16
Participants
Unknown
Messages
17
Rank 2: Process
Hey, is it possible to initially set the preferences of a user without being logged in, i.e. after an account as been created?
Rank 2: Process
I want to generate a code for every account and would like to save it after registration, how is that possible or is the update preferences endpoint not meant for such things?
Admin
what is this code used for?
Rank 2: Process
Its a unique code that users of the app can share to connect with eachother
Rank 2: Process
And I dont want to use the DB ID of that user for that
Rank 2: Process
Its not something the user is supposed to change
Admin
and what if they delete that value?
Admin
users are free to update user preferences so it might not be good to store that value in there
Rank 2: Process
I see, so I should create a document for that
Rank 2: Process
Or can I save metadata other then update preferences?
Rank 2: Process
For accounts
Rank 2: Process
And another question, should this document be created server side or client side? If I dont want it to be changed at all by anyone that is
Admin
what do you mean?
Admin
server side. best thing is to probably have a function trigger on account creation
Rank 2: Process
Im basically trying to save metadata for each account that has been created, but this meta data should be static. I wanted to avoid duplicating the accounts db id, but I guess thats the path I should take. A triggers seems right
Admin
our typical approach is to create a Users/Profiles collection where each document is a user. the id of the document should match the id of hte user. then, you can add attributes for whatever custom data you need to store
Rank 2: Process
[SOLVED] Setting user preference after registration