Skip to content

Instantly share code, notes, and snippets.

@a-eid
Created March 6, 2020 14:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save a-eid/9c023fd36ce5f1ecead6b273e6eede4b to your computer and use it in GitHub Desktop.
Save a-eid/9c023fd36ce5f1ecead6b273e6eede4b to your computer and use it in GitHub Desktop.
import fetch from "node-fetch"
// expected to return => {token: "", filledAccountData: {authMethod: "EMAIL_AND_PASSWORD", userId: ""}}
export async function login(email, password, deviceId) {
return await fetch("https://api.airbnb.com/v2/authentications?client_id=3092nxybyb0otqw18e8nh5nty&locale=en-GB&currency=GBP", {
body: JSON.stringify({
authenticationParams: { email: { email, password } },
}),
headers: {
"Content-Type": "application/json; charset=UTF-8",
"X-Airbnb-Device-Id": deviceId,
},
method: "POST",
}).then(res => res.json())
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment