Skip to content

Instantly share code, notes, and snippets.

@a-eid

a-eid/login.js

Created Mar 6, 2020
Embed
What would you like to do?
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
You can’t perform that action at this time.