Answers for "auth fetch user"

2

how to send basic auth using fetch

fetch(url, {
	...options, 
	headers: {
    	'Authorization': 'Basic ' + btoa(`${username}:${password}`)
    }
})
.then(response => response.json())
.then(json => console.log(json));
Posted by: Guest on October-11-2020
0

function to fetch user details

$user = get_user_by( 'email', '[email protected]' );
$user = get_user_by('login', $username);
echo 'User is ' . $user->first_name . ' ' . $user->last_name;
Posted by: Guest on October-29-2021

Code answers related to "BASIC"

Browse Popular Code Answers by Language