Skip to content

Commit

Permalink
Fix lint errors.
Browse files Browse the repository at this point in the history
Signed-off-by: Dave Smith <[email protected]>
Change-Id: I64d7b901d5362bfa07506d2f5b24426425992e1f
  • Loading branch information
Dave Smith committed Jun 23, 2020
1 parent 31c3bd5 commit 08a5fb7
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 14 deletions.
24 changes: 14 additions & 10 deletions washer-done/functions/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,11 @@ exports.login = functions.https.onRequest((request, response) => {
<meta name="viewport" content="width=device-width, initial-scale=1">
<body>
<form action="/login" method="post">
<input type="hidden" name="responseurl" value="${request.query.responseurl}" />
<button type="submit" style="font-size:14pt">Link this service to Google</button>
<input type="hidden"
name="responseurl" value="${request.query.responseurl}" />
<button type="submit" style="font-size:14pt">
Link this service to Google
</button>
</form>
</body>
</html>
Expand All @@ -63,8 +66,9 @@ exports.fakeauth = functions.https.onRequest((request, response) => {
const responseurl = util.format('%s?code=%s&state=%s',
decodeURIComponent(request.query.redirect_uri), 'xxxxxx',
request.query.state);
console.log(`Set redirect as ${responseurl}`)
return response.redirect(`/login?responseurl=${encodeURIComponent(responseurl)}`);
console.log(`Set redirect as ${responseurl}`);
return response.redirect(
`/login?responseurl=${encodeURIComponent(responseurl)}`);
});

exports.faketoken = functions.https.onRequest((request, response) => {
Expand Down Expand Up @@ -209,12 +213,12 @@ app.onQuery(async (body) => {
const intent = body.inputs[0];
for (const device of intent.payload.devices) {
const deviceId = device.id;
queryPromises.push(queryDevice(deviceId)
.then((data) => {
// Add response to device payload
payload.devices[deviceId] = data;
},
));
queryPromises.push(
queryDevice(deviceId)
.then((data) => {
// Add response to device payload
payload.devices[deviceId] = data;
}) );
}
// Wait for all promises to resolve
await Promise.all(queryPromises);
Expand Down
12 changes: 8 additions & 4 deletions washer-start/functions/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,11 @@ exports.login = functions.https.onRequest((request, response) => {
<meta name="viewport" content="width=device-width, initial-scale=1">
<body>
<form action="/login" method="post">
<input type="hidden" name="responseurl" value="${request.query.responseurl}" />
<button type="submit" style="font-size:14pt">Link this service to Google</button>
<input type="hidden"
name="responseurl" value="${request.query.responseurl}" />
<button type="submit" style="font-size:14pt">
Link this service to Google
</button>
</form>
</body>
</html>
Expand All @@ -63,8 +66,9 @@ exports.fakeauth = functions.https.onRequest((request, response) => {
const responseurl = util.format('%s?code=%s&state=%s',
decodeURIComponent(request.query.redirect_uri), 'xxxxxx',
request.query.state);
console.log(`Set redirect as ${responseurl}`)
return response.redirect(`/login?responseurl=${encodeURIComponent(responseurl)}`);
console.log(`Set redirect as ${responseurl}`);
return response.redirect(
`/login?responseurl=${encodeURIComponent(responseurl)}`);
});

exports.faketoken = functions.https.onRequest((request, response) => {
Expand Down

0 comments on commit 08a5fb7

Please sign in to comment.