Closed lymanlai closed 9 years ago
@lymanlai What this http://api.austack.com/api/users/createInvitationCode/5596b9bd30e816d8f84bba34/:invitationCode used for ?
@lymanlai What's the data format to create an Invitation Code ?
/**
* The InvitationCode model definition
* @type {Object}
* @property {String} name - The name of this invitationCode
* @property {String} info - Details about this invitationCode
* @property {Boolean} active - Flag indicating this invitationCode is active
*/
var InvitationCodeDefinition = {
invitationCode: String
};
{
invitationCode: xx # some Non-sequential, not predictable, unique string
};
there should be a field to indicate whether it's used or not, or a userID to indicate who use it
@nihgwu we made it simple, just one string, it is Non-sequential, not predictable, unique string.
Just save time.
@nihgwu already done in code, but not work that if we do it from mongodb cli
InvitationCodeSchema
.path('invitationCode')
.validate(validateUniqueInvitationCode, 'The specified invitationCode is already in use.');
It is not just a compromise, from the security aspect, it is acceptable.
{
"invitationCode": ""
}
189
create code:
http://localhost:9001/api/users/createInvitationCode/5596b9bd30e816d8f84bba34/:invitationCode on musa will be
http://api.austack.com/api/users/createInvitationCode/5596b9bd30e816d8f84bba34/:invitationCode