Files
ewelink-api/lib/payloads/credentialsPayload.js
Martin M 6e240c181f Release v1.10.0 (#38)
* 100% coverage for mixins/user/regionMixin.js

* check if websocket connection is valid json

* removed unnecessary delays

* added more test cases

* move constants to json files

* renamed login method to getCredentials

* mixin renamed

* don’t export internal methods

* mixin renamed

* keep socket connection opened

* using new getCredentials method

* reanmed login to credentials

* version bump
2019-11-29 02:25:38 -03:00

20 lines
450 B
JavaScript

const nonce = require('nonce')();
const { makeFakeIMEI } = require('../ewelink-helper');
const credentialsPayload = ({ email, password }) => ({
email,
password,
version: 6,
ts: `${Math.round(new Date().getTime() / 1000)}`,
nonce: `${nonce()}`,
appid: 'oeVkj2lYFGnJu5XUtWisfW4utiN4u9Mq',
imei: makeFakeIMEI(),
os: 'iOS',
model: 'iPhone10,6',
romVersion: '11.1.2',
appVersion: '3.5.3',
});
module.exports = credentialsPayload;