Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ReferenceError: Token is not defined #31

Open
pksec opened this issue Apr 25, 2020 · 1 comment
Open

ReferenceError: Token is not defined #31

pksec opened this issue Apr 25, 2020 · 1 comment

Comments

@pksec
Copy link
Member

pksec commented Apr 25, 2020

ReferenceError: token is not defined also on: https://covid-self-report.ch/report

app.bdb2b255.js:1 ReferenceError: token is not defined
at a. (app.bdb2b255.js:1)
at u (chunk-vendors.4669dcc6.js:30)
at Generator._invoke (chunk-vendors.4669dcc6.js:30)
at Generator.forEach.t. [as next] (chunk-vendors.4669dcc6.js:30)
at o (chunk-vendors.4669dcc6.js:19)
at s (chunk-vendors.4669dcc6.js:19)

@pksec
Copy link
Member Author

pksec commented Apr 25, 2020

Fix :

 try {
            const headers = new Headers();
            headers.append("Content-Type", "application/json");

const token = await this.$recaptcha('report');

            const response = await fetch(process.env.VUE_APP_API_ENDPOINT_REPORT, {
              method: 'POST',
              headers,
              mode: 'cors',
              cache: 'default',
              body: JSON.stringify({
                token: token,
                locator: this.reportData.postalCode,
                sessionId: this.reportData.sessionId,
                symptoms: symptoms,
                symptomsDays: this.reportData.symptomsDays,
                diagnostic: this.reportData.diagnostic,
                appVersion: process.env.VERSION,
              }),
            });

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant