From 3612b363c483ec025020a8eb9b9d265fbaa1cc0c Mon Sep 17 00:00:00 2001 From: Thomas Minke Date: Thu, 25 Apr 2024 22:11:42 +0200 Subject: [PATCH] - Set Formio's `projectUrl` and `authUrl to the current origin, so that api.form.io no longer is used as a default. - Set the user in Formio so that the `/current` endpoint is no longer called. --- .../src/lib/components/form-io/form-io.component.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/projects/valtimo/components/src/lib/components/form-io/form-io.component.ts b/projects/valtimo/components/src/lib/components/form-io/form-io.component.ts index f81ec649b..86ae60dc0 100644 --- a/projects/valtimo/components/src/lib/components/form-io/form-io.component.ts +++ b/projects/valtimo/components/src/lib/components/form-io/form-io.component.ts @@ -111,6 +111,9 @@ export class FormioComponent implements OnInit, OnChanges, OnDestroy { ) {} public ngOnInit() { + Formio.setProjectUrl(location.origin); + Formio.authUrl = location.origin; + this.openRouteSubscription(); this.errors$.next([]); this.setInitialToken(); @@ -190,6 +193,7 @@ export class FormioComponent implements OnInit, OnChanges, OnDestroy { } private setToken(token: string): void { + Formio.setUser(jwt_decode(token)); Formio.setToken(token); localStorage.setItem('formioToken', token); this.setTimerForTokenRefresh(token);