diff --git a/package.json b/package.json index 9f2adc4b..55b91e8f 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "deploy": "sst deploy --outputs-file .test-env.json", "remove": "sst remove", "console": "sst console", - "lint": "tsc && eslint '**/*.js'", + "lint": "tsc && eslint '**/*.js' '**/*.jsx'", "clean": "rm -rf dist node_modules package-lock.json ./*/{.cache,dist,node_modules}", "test": "npm test -w billing -w upload-api -w carpark -w replicator -w roundabout -w filecoin -w indexer", "test-integration": "ava --verbose --serial --timeout=660s --fail-fast test/*.test.js", diff --git a/upload-api/functions/validate-email.jsx b/upload-api/functions/validate-email.jsx index 2a4066d1..2e8b8780 100644 --- a/upload-api/functions/validate-email.jsx +++ b/upload-api/functions/validate-email.jsx @@ -13,8 +13,8 @@ import { createConsumerTable } from '../tables/consumer.js' import { createRevocationsTable } from '../stores/revocations.js' import * as AgentStore from '../stores/agent.js' import { useProvisionStore } from '../stores/provisions.js' -import * as htmlStoracha from '../html-storacha' -import * as htmlW3s from '../html-w3s' +import * as htmlStoracha from '../html-storacha/index.js' +import * as htmlW3s from '../html-w3s/index.js' import { createRateLimitTable } from '../tables/rate-limit.js' import { createSpaceMetricsTable } from '../tables/space-metrics.js' import { createCustomerStore } from '@web3-storage/w3infra-billing/tables/customer' @@ -52,7 +52,6 @@ export function toLambdaResponse(response) { * @param {import('aws-lambda').APIGatewayProxyEventV2} request */ export async function validateEmailGet(request) { - request.requestContext.domainName if (!request.queryStringParameters?.ucan) { return toLambdaResponse( new html.HtmlResponse( diff --git a/upload-api/html-storacha/index.jsx b/upload-api/html-storacha/index.jsx index 24e141ef..d25ed956 100644 --- a/upload-api/html-storacha/index.jsx +++ b/upload-api/html-storacha/index.jsx @@ -15,108 +15,109 @@ import storachaLogoSvg from './storacha-logo.svg' */ export function buildDocument(body) { return /* html */ ` - - - - - Storacha Email Validation - - - - - - - - - ${body} - -` + button { + background-color: var(--hot-yellow-light); + color: var(--hot-red); + font-weight: 500; + border: none; + border-radius: 0.25rem; + padding: 0.5rem 1rem; + margin-top: 1rem; + } + + + + ${body} + + + ` } export class HtmlResponse extends Response { diff --git a/upload-api/html-w3s/index.jsx b/upload-api/html-w3s/index.jsx index cb21ac0a..5523c9a2 100644 --- a/upload-api/html-w3s/index.jsx +++ b/upload-api/html-w3s/index.jsx @@ -1,4 +1,5 @@ // @jsxImportSource preact +import * as preact from 'preact' import { render } from 'preact-render-to-string' import { Response } from '@web-std/fetch'