Skip to content

Commit f700e75

Browse files
adjust to new request-supporter-cert API
1 parent ed8a030 commit f700e75

File tree

7 files changed

+10
-8
lines changed

7 files changed

+10
-8
lines changed

assets/js/const.template.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"use strict";
22

3-
const API_BASE_URL = '{{ .Site.Params.apiBaseURL }}';
3+
const API_BASE_URL = '{{ .Site.Params.apiBaseUrl }}';
44
const LEGACY_API_URL = '{{ .Site.Params.legacyApiUrl }}';
55
const PADDLE_ENABLE_SANDBOX = {{ .Site.Params.paddleEnableSandbox }};
66
const PADDLE_TOKEN = '{{ .Site.Params.paddleToken }}';

assets/js/supportercert.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"use strict";
22

3-
const REQUEST_SUPPORTER_CERT_URL = LEGACY_STORE_URL + '/desktop/request-supporter-cert';
3+
const REQUEST_SUPPORTER_CERT_URL = API_BASE_URL + '/connect/contact/request-supporter-cert';
44

55
class SupporterCertificate {
66

@@ -23,7 +23,9 @@ class SupporterCertificate {
2323
$.ajax({
2424
url: REQUEST_SUPPORTER_CERT_URL,
2525
type: 'POST',
26-
data: this._submitData
26+
data: JSON.stringify(this._submitData),
27+
contentType: "application/json; charset=utf-8",
28+
dataType: "json"
2729
}).done(_ => {
2830
this.onRequestSucceeded();
2931
}).fail(xhr => {

config/_default/hugo.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ server:
8484
script-src 'self' 'unsafe-eval' https://umami.skymatic.de/ https://community.cryptomator.org/ https://js.stripe.com/ https://*.paddle.com/;
8585
style-src 'self' 'unsafe-inline' https://*.paddle.com/;
8686
img-src 'self' data: https://static.cryptomator.org/ https://*.paddle.com/ https://paddle.s3.amazonaws.com/ https://avatars.githubusercontent.com/;
87-
connect-src 'self' https://api.cryptomator.org/ https://store.cryptomator.org/ https://umami.skymatic.de/ https://*.paddle.com/ http://localhost/ http://localhost:8787/;
87+
connect-src 'self' https://api.cryptomator.org/ https://store.cryptomator.org/ https://umami.skymatic.de/ https://*.paddle.com/ http://localhost/ http://localhost:8787/ http://localhost:3300/ http://localhost:8080/;
8888
font-src 'self';
8989
media-src https://static.cryptomator.org/;
9090
frame-src https://community.cryptomator.org/ https://js.stripe.com/ https://*.paddle.com/;

config/development/params.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# API
2-
apiBaseURL: http://localhost:3300
2+
apiBaseUrl: http://localhost:3300
33
legacyApiUrl: http://localhost
44
legacyStoreUrl: http://localhost:8787/api
55

config/production/params.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# API
2-
apiBaseURL: https://api.cryptomator.org
2+
apiBaseUrl: https://api.cryptomator.org
33
legacyApiUrl: http://api.cryptomator.org
44
legacyStoreUrl: https://store.cryptomator.org/api
55

config/staging/params.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# API
2-
apiBaseURL: https://api-staging.cryptomator.org
2+
apiBaseUrl: https://api-staging.cryptomator.org
33
legacyApiUrl: http://localhost
44
legacyStoreUrl: http://localhost:8787/api
55

layouts/partials/supporter-cert-contributor.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
<button :disabled="feedbackData.inProgress || !acceptTerms || captchaState == 'verifying'" type="submit" class="btn btn-primary w-full md:w-64" data-umami-event="supporter-cert-contributor-form" x-cloak>
1919
<i :class="{'fa-paper-plane': !feedbackData.inProgress, 'fa-spinner fa-spin': feedbackData.inProgress}" class="fa-solid" aria-hidden="true"></i> {{ i18n "supporter_cert_common_submit" }}
2020
</button>
21-
{{ $captchaUrl := printf "%s/altcha/challenge.php" .Site.Params.legacyApiUrl }}
21+
{{ $captchaUrl := printf "%s/connect/contact/challenge" .Site.Params.apiBaseUrl }}
2222
{{ partial "captcha.html" (dict "challengeUrl" $captchaUrl "captchaPayload" "submitData.captcha" "captchaState" "captchaState") }}
2323
<p :class="{'hidden': !feedbackData.errorMessage}" class="text-sm text-red-600 mt-2" x-text="feedbackData.errorMessage"></p>
2424
</div>

0 commit comments

Comments
 (0)