read local env URL endpoint from .env.local, and change text color to white for easier reading
This commit is contained in:
parent
c4ba2c8625
commit
fac45c616b
|
@ -2,10 +2,12 @@ import type {NextApiRequest, NextApiResponse} from "next";
|
|||
|
||||
type ConfigData = {
|
||||
apiBaseUrl: string
|
||||
verifierHost: string
|
||||
}
|
||||
|
||||
export default function handler(req: NextApiRequest, res: NextApiResponse<ConfigData>) {
|
||||
// Return the API_BASE_URL. This Endpoint allows us to access the env Variable in client javascript
|
||||
res.status(200).json({apiBaseUrl: process.env.API_BASE_URL})
|
||||
|
||||
res.status(200).json({apiBaseUrl: process.env.API_BASE_URL, verifierHost: process.env.VERIFIER_HOST})
|
||||
}
|
||||
|
||||
|
|
12
src/pass.ts
12
src/pass.ts
|
@ -102,12 +102,10 @@ export class PassData {
|
|||
}
|
||||
|
||||
console.log('registering ' + JSON.stringify(clonedReceipt, null, 2));
|
||||
const configResponse = await fetch('/api/config')
|
||||
const verifierHost = (await configResponse.json()).verifierHost
|
||||
|
||||
// const configResponse = await fetch('/api/config')
|
||||
// const verifierHost = (await configResponse.json()).verifierHost
|
||||
|
||||
const verifierHost = 'https://verifier.vaccine-ontario.ca';
|
||||
// const verifierHost = 'http://localhost:5001/grassroot-verifier/us-central1';
|
||||
// const verifierHost = 'https://verifier.vaccine-ontario.ca';
|
||||
|
||||
const response = await fetch(`${verifierHost}/register`, requestOptions);
|
||||
const responseJson = await response.json();
|
||||
|
@ -119,7 +117,7 @@ export class PassData {
|
|||
|
||||
// Create QR Code Object
|
||||
const qrCode: QrCode = {
|
||||
message: `https://verifier.vaccine-ontario.ca/verify?serialNumber=${payload.serialNumber}&vaccineName=${payload.receipt.vaccineName}&vaccinationDate=${payload.receipt.vaccinationDate}&organization=${payload.receipt.organization}&dose=${payload.receipt.numDoses}`,
|
||||
message: `${verifierHost}/verify?serialNumber=${payload.serialNumber}&vaccineName=${payload.receipt.vaccineName}&vaccinationDate=${payload.receipt.vaccinationDate}&organization=${payload.receipt.organization}&dose=${payload.receipt.numDoses}`,
|
||||
format: QrFormat.PKBarcodeFormatQR,
|
||||
messageEncoding: Encoding.iso88591,
|
||||
// altText : payload.rawData
|
||||
|
@ -171,7 +169,7 @@ export class PassData {
|
|||
// Sign hash with server
|
||||
const manifestSignature = await PassData.signWithRemote({
|
||||
PassJsonHash: passHash,
|
||||
useBlackVersion: true,
|
||||
useBlackVersion: false,
|
||||
});
|
||||
|
||||
// Add signature to zip
|
||||
|
|
|
@ -112,10 +112,10 @@ export class Payload {
|
|||
this.backgroundColor = COLORS.YELLOW;
|
||||
}
|
||||
|
||||
this.labelColor = COLORS.BLACK
|
||||
this.foregroundColor = COLORS.BLACK
|
||||
this.img1x = Constants.img1xBlack
|
||||
this.img2x = Constants.img2xBlack
|
||||
this.labelColor = COLORS.WHITE
|
||||
this.foregroundColor = COLORS.WHITE
|
||||
this.img1x = Constants.img1xWhite
|
||||
this.img2x = Constants.img2xWhite
|
||||
this.generic = generic;
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue