miniOrangeDev / moodle-local_mo_api

Moodle SSO solution by miniOrange allows your users to login to multiple applications via their Moodle credentials.
GNU General Public License v2.0
0 stars 1 forks source link

Using equality operator when comparing API key #2

Open mudrd8mz opened 3 years ago

mudrd8mz commented 3 years ago

Let the code talk:

<?php

$apikey = '0e462097431906509019562988736854';
$submitted = json_decode('{"api_key": 0}', true);

if ($apikey == $submitted['api_key']) {
    echo "Match!";
}

which is what you do in https://github.com/miniOrangeDev/moodle-local_mo_api/blob/7f44e0a01ea8af854cfd3daa4929765d3c0daf3d/api.php#L37