cont3xt/vueapp/src/components/services/UserService.js
/**
   * Changes current user's password
   * @param {object} data - The data to send to the server
   *                        { currentPassword, newPassword }
   * @returns {Promise} - The promise that either resovles the request or rejects in error
   */
Changes current user's password
@param {object} data - The data to send to the server
{ currentPassword, newPassword }
@returns {Promise} - The promise that either resovles the request or rejects in error
Changes current user ' s password @param { object } data - The data to send to the server { currentPassword newPassword } @returns { Promise } - The promise that either resovles the request or rejects in error
changePassword (data) {
    return new Promise((resolve, reject) => {
      fetch('api/user/password', {
        method: 'POST',
        headers: setReqHeaders({ 'Content-Type': 'application/json' }),
        body: JSON.stringify(data)
      }).then((response) => {
        return response.json();
      }).then((response) => {
        if (response.success) {
          return resolve(response);
        } else {
          return reject(response.text);
        }
      });
    });
  }
changePassword ( data ) { return new Promise ( ( resolve , reject ) => { fetch ( 'api/user/password' , { method : 'POST' , headers : setReqHeaders ( { 'Content-Type' : 'application/json' } ) , body : JSON . stringify ( data ) } ) . then ( ( response ) => { return response . json ( ) ; } ) . then ( ( response ) => { if ( response . success ) { return resolve ( response ) ; } else { return reject ( response . text ) ; } } ) ; } ) ; }
Changes current user's password
 @param {object} data - The data to send to the server
                        { currentPassword, newPassword }
 @returns {Promise} - The promise that either resovles the request or rejects in error
Changes current user ' s password @param { object } data - The data to send to the server { currentPassword newPassword } @returns { Promise } - The promise that either resovles the request or rejects in error