api_server/modules/users/gitlens_user_request.js
// add the GitLens user to our database
add the GitLens user to our database
add the GitLens user to our database
async addGitLensUser () {
		const document = {
			emailHash: this.request.body.emailHash.toLowerCase()
		};
		if (this.request.body.machineIdHash) {
			document.machineIdHash = this.request.body.machineIdHash.toLowerCase();
		}
		const existing = await this.api.data.gitLensUsers.getOneByQuery(document, { hint: GitLensUserIndexes.byEmailHash });
		if (existing) {
			return;
		}
		document.createdAt = Date.now();
		return this.api.data.gitLensUsers.create(document, { noVersion: true });
	}
async addGitLensUser ( ) { const document = { emailHash : this . request . body . emailHash . toLowerCase ( ) } ; if ( this . request . body . machineIdHash ) { document . machineIdHash = this . request . body . machineIdHash . toLowerCase ( ) ; } const existing = await this . api . data . gitLensUsers . getOneByQuery ( document , { hint : GitLensUserIndexes . byEmailHash } ) ; if ( existing ) { return ; } document . createdAt = Date . now ( ) ; return this . api . data . gitLensUsers . create ( document , { noVersion : true } ) ; }
add the GitLens user to our database
add the GitLens user to our database
// prevent duplicates