server/services/authService.js
// Note: doesn't validate the username so it must be validated before calling the method
doesn't validate the username so it must be validated before calling the method
doesn ' t validate the username so it must be validated before calling the method
static changeUsername(token, username) {
    return AuthService.findUserByToken(token)
      .then((user) => { 
        return UserStatistics.update({ username: user.username }, { $set: { username: username } }).then(() => {
          user.username = username;
          return user.save();
        });
      });
  }
static changeUsername ( token , username ) { return AuthService . findUserByToken ( token ) . then ( ( user ) => { return UserStatistics . update ( { username : user . username } , { $set : { username : username } } ) . then ( ( ) => { user . username = username ; return user . save ( ) ; } ) ; } ) ; }
Note: doesn't validate the username so it must be validated before calling the method
Note : doesn ' t validate the username so it must be validated before calling the method
// eslint-disable-line arrow-body-style