const fetchUser = async () =>{
let username : any = (document.getElementById('username') as HTMLInputElement).value;
let password : any = (document.getElementById('password') as HTMLInputElement).value;
const profile = await fetch("https://api.github.com/user", {
headers:{
'Authorization': 'Basic ' + window.btoa(username + ":" + password)
}
})
const profileResponse = await profile.json()
console.log(profileResponse)
}
const handleSubmit =(e:any) =>{
e.preventDefault()
fetchUser()
}
I tried to log in with GitHub credentials using GitHub API but it returns the required authentication