Plugin Directory

Changeset 3050260


Ignore:
Timestamp:
03/13/2024 07:54:25 AM (2 years ago)
Author:
atomchat
Message:

Auth token verification for mycred plugin and tested with latest version

Location:
atomchat/trunk
Files:
1 deleted
2 edited

Legend:

Unmodified
Added
Removed
  • atomchat/trunk/README.txt

    r2967377 r3050260  
    44Requires at least: 4.7
    55Requires PHP: 5.6
    6 Tested up to: 6.2
    7 Stable tag: 1.1.4
     6Tested up to: 6.4
     7Stable tag: 1.1.5
    88License: GNU General Public License v2.0 or later
    99
     
    183183= 1.1.4 =
    184184* Added skip for now to the installation process
     185
     186= 1.1.5 =
     187* Auth token verification for mycred plugin
  • atomchat/trunk/atomchat.php

    r2967377 r3050260  
    44* Plugin Name: AtomChat
    55* Description: Voice, video & text chat for your WordPress site
    6 * Version: 1.1.4
     6* Version: 1.1.5
    77* Author: AtomChat
    88* Author URI: https://www.atomchat.com/
     
    218218            'methods' => 'POST',
    219219            'callback' => 'atomchatDeductPointsCallback',
    220             'permission_callback' => '__return_true',
     220            'permission_callback' => 'atomchatDeductPointsPermissionCheck',
    221221        ]);
    222222    });
     223}
     224
     225function atomchatDeductPointsPermissionCheck(WP_REST_Request $request) {
     226    $atomchat_auth_key = get_option('atomchat_auth_key');
     227    $encryption_key = $request->get_param('encryption_key');
     228    if (password_verify($atomchat_auth_key, $encryption_key)) {
     229        return true;
     230    } else {
     231        return false;
     232    }
    223233}
    224234
Note: See TracChangeset for help on using the changeset viewer.