Created
April 8, 2021 12:01
-
-
Save vikramjeet-dev/caa8a223daed08abae9f2449077772d6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
header('Access-Control-Allow-Origin: *'); | |
header('Access-Control-Allow-Methods: GET, POST'); | |
header("Access-Control-Allow-Headers: X-Requested-With"); | |
include('wp-load.php'); | |
$usernme = $_GET['usermail']; | |
$pass = $_GET['password']; | |
$userpass = md5($pass); | |
if(isset($usernme) && !empty($pass)){ | |
$user = get_user_by( 'login', $usernme ); | |
if (wp_check_password( $pass, $user->data->user_pass, $user->ID) ) | |
{ | |
/*wp_setcookie($usernme, $pass, true); | |
wp_set_current_user($user->ID, $usernme); | |
do_action('wp_login', $usernme);*/ | |
//wp_redirect(home_url()); | |
$all_meta_for_user = get_user_meta($user->ID); | |
$json = json_encode($all_meta_for_user); | |
echo $json; | |
} | |
else | |
{ echo "Incorrect Password"; } } | |
else{ echo 'Something went wrong'; } | |
header('Content-type: application/json'); | |
exit; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment