Skip to content

Commit d0e488e

Browse files
pass #oldLicense=... to license refresh endpoint
1 parent 4054f2b commit d0e488e

2 files changed

Lines changed: 7 additions & 8 deletions

File tree

assets/js/hubce.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
// requires newsletter.js
44
const VERIFY_EMAIL_URL = API_BASE_URL + '/connect/email/verify';
5-
const CLAIM_LICENSE_URL = API_BASE_URL + '/licenses/hub/prod';
5+
const REFRESH_LICENSE_URL = API_BASE_URL + '/licenses/hub/refresh';
66

77
class HubCE {
88

@@ -11,7 +11,7 @@ class HubCE {
1111
this._feedbackData = feedbackData;
1212
this._submitData = submitData;
1313
this._searchParams = searchParams;
14-
this._submitData.hubId = searchParams.get('hubId');
14+
this._submitData.oldLicense = searchParams.get('oldLicense');
1515

1616
// continue after email verified:
1717
if (searchParams.get('verifiedEmail')) {
@@ -65,7 +65,7 @@ class HubCE {
6565
type: 'POST',
6666
data: {
6767
email: this._submitData.email,
68-
hubId: this._submitData.hubId,
68+
oldLicense: this._submitData.oldLicense,
6969
verifyCaptcha: this._submitData.captcha,
7070
verifyEmail: this._submitData.email,
7171
verifyTarget: 'registerhubce'
@@ -82,11 +82,10 @@ class HubCE {
8282

8383
getHubLicense() {
8484
$.ajax({
85-
url: CLAIM_LICENSE_URL,
85+
url: REFRESH_LICENSE_URL,
8686
type: 'POST',
8787
data: {
88-
hubId: this._submitData.hubId,
89-
captcha: this._submitData.captcha
88+
token: this._submitData.oldLicense
9089
}
9190
}).done(response => {
9291
this._feedbackData.licenseText = response;

layouts/hub-register/single.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
{{ partial "altcha-css.html" . }}
33
{{ end }}
44
{{ define "main" }}
5-
<section x-data="{steps: ['{{ i18n "hub_ce_registration_step_1_nav_title" }}', '{{ i18n "hub_ce_registration_step_2_confirmation_nav_title" }}', '{{ i18n "hub_ce_registration_step_3_license_nav_title" }}'], feedbackData: {currentStep: 0, success: false, inProgress: false, errorMessage: '', licenseText: null}, submitData: {captcha: null, hubId: '', email: '', acceptNewsletter: false}, acceptTerms: false, hubCE: null, captchaState: null}" x-init="hubCE = new HubCE($refs.form, feedbackData, submitData, new URLSearchParams(location.search))" class="container py-12">
5+
<section x-data="{steps: ['{{ i18n "hub_ce_registration_step_1_nav_title" }}', '{{ i18n "hub_ce_registration_step_2_confirmation_nav_title" }}', '{{ i18n "hub_ce_registration_step_3_license_nav_title" }}'], feedbackData: {currentStep: 0, success: false, inProgress: false, errorMessage: '', licenseText: null}, submitData: {captcha: null, oldLicense: '', email: '', acceptNewsletter: false}, acceptTerms: false, hubCE: null, captchaState: null}" x-init="hubCE = new HubCE($refs.form, feedbackData, submitData, new URLSearchParams(location.hash.substring(1)))" class="container py-12">
66
<header class="mb-6">
77
<h1 class="font-h1 mb-8">{{ .Title }}</h1>
88
<p class="lead">{{ i18n "hub_ce_registration_description" }}</p>
@@ -82,7 +82,7 @@ <h2 class="font-h2 mb-6">
8282
<input type="email" id="email" class="block input-box w-full mb-8" placeholder="{{ i18n "hub_ce_registration_step_1_email_placeholder" }}" x-init="$el.focus()" x-model="submitData.email" @blur="$el.classList.add('show-invalid')" required>
8383
<div class="mt-auto">
8484
<p :class="{'hidden': !feedbackData.errorMessage}" class="text-sm text-red-600 mb-2" x-text="feedbackData.errorMessage"></p>
85-
<button :disabled="feedbackData.inProgress || !submitData.hubId" @click.prevent="hubCE.validateEmail()" class="btn btn-primary w-full md:w-64" data-umami-event="hub-ce-registration-step-1">
85+
<button :disabled="feedbackData.inProgress || !submitData.oldLicense" @click.prevent="hubCE.validateEmail()" class="btn btn-primary w-full md:w-64" data-umami-event="hub-ce-registration-step-1">
8686
<i :class="{'fa-chevron-right': !feedbackData.inProgress, 'fa-spinner fa-spin': feedbackData.inProgress}" class="fa-solid" aria-hidden="true"></i>
8787
{{ i18n "hub_ce_registration_steps_next" }}
8888
</button>

0 commit comments

Comments
 (0)