Nuovo Sistema di registrazione:

tramite il BOT, viene memorizzato l'username telegram e si usa quello come username per la APP, e l'ID telegram viene passato direttamente, senza chiedere la verifica.

- ospitalità (inizio).
This commit is contained in:
Paolo Arena
2022-05-04 00:26:12 +02:00
parent 5139d321b5
commit 311e714d7d
9 changed files with 720 additions and 91 deletions

View File

@@ -549,7 +549,7 @@ UserSchema.statics.findByCredentials = function(idapp, username, password, pwdcr
const User = this;
let pwd = '';
let regexp = new RegExp(`${username}`, 'i');
let regexp = new RegExp(`^${username}$`, 'i');
return User.findOne({
idapp,
@@ -647,7 +647,7 @@ UserSchema.statics.findByUsername = async function(idapp, username, alsoemail, o
UserSchema.statics.getUserShortDataByUsername = async function(idapp, username) {
const User = this;
let regexp = new RegExp(`${username}`, 'i');
let regexp = new RegExp(`^${username}$`, 'i');
const myrec = await User.findOne({
'idapp': idapp,
@@ -2196,7 +2196,7 @@ UserSchema.statics.getNameSurnameByUsername = async function(
UserSchema.statics.getIdByUsername = async function(idapp, username) {
const User = this;
let regexp = new RegExp(`${username}`, 'i');
let regexp = new RegExp(`^${username}$`, 'i');
return User.findOne({
idapp,
@@ -2212,7 +2212,7 @@ UserSchema.statics.getIdByUsername = async function(idapp, username) {
UserSchema.statics.getRealUsernameByUsername = async function(idapp, username) {
const User = this;
let regexp = new RegExp(`${username}`, 'i');
let regexp = new RegExp(`^${username}$`, 'i');
return User.findOne({
idapp,