Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Append token version to request

Oliver Günther076e8725eae1
diff --git a/app/controllers/enterprises_controller.rb b/app/controllers/enterprises_controller.rb
index 44d80968c3b..73cbeb10ecd 100644
--- a/app/controllers/enterprises_controller.rb
+++ b/app/controllers/enterprises_controller.rb
@@ -110,6 +110,7 @@ class EnterprisesController < ApplicationController
def write_augur_to_gon
gon.augur_url = OpenProject::Configuration.enterprise_trial_creation_host
+ gon.token_version = OpenProject::Token::VERSION
end
def default_breadcrumb
diff --git a/frontend/src/app/components/enterprise/enterprise-trial.service.ts b/frontend/src/app/components/enterprise/enterprise-trial.service.ts
index 102270a38a1..9ce8b4666bd 100644
--- a/frontend/src/app/components/enterprise/enterprise-trial.service.ts
+++ b/frontend/src/app/components/enterprise/enterprise-trial.service.ts
@@ -22,8 +22,8 @@ export class EnterpriseTrialService {
// user data needs to be sync in ee-active-trial.component.ts
userData$ = input<EnterpriseTrialData>();
- public baseUrlAugur:string;
-
+ public readonly baseUrlAugur:string;
+ public readonly tokenVersion:string;
public trialLink:string;
public resendLink:string;
@@ -46,6 +46,7 @@ export class EnterpriseTrialService {
protected notificationsService:NotificationsService) {
let gon = (window as any).gon;
this.baseUrlAugur = gon.augur_url;
+ this.tokenVersion = gon.token_version;
if ((window as any).gon.ee_trial_key) {
this.setMailSubmittedStatus();
@@ -55,7 +56,8 @@ export class EnterpriseTrialService {
// send POST request with form object
// receive an enterprise trial link to access a token
public sendForm(form:FormGroup) {
- this.http.post(this.baseUrlAugur + '/public/v1/trials', form.value)
+ const request = { ...form.value, token_version: this.tokenVersion};
+ this.http.post(this.baseUrlAugur + '/public/v1/trials', request)
.toPromise()
.then((enterpriseTrial:any) => {
this.userData$.putValue(form.value);