Created
March 6, 2020 14:13
-
-
Save a-eid/9c023fd36ce5f1ecead6b273e6eede4b 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
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¤cy=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