diff --git a/apps/36-blocks-widget/src/app/app.component.ts b/apps/36-blocks-widget/src/app/app.component.ts index 5269e5ec..2290db1b 100644 --- a/apps/36-blocks-widget/src/app/app.component.ts +++ b/apps/36-blocks-widget/src/app/app.component.ts @@ -5,11 +5,10 @@ import { BaseComponent } from '@proxy/ui/base-component'; import { WidgetTheme, PublicScriptType, WidgetConfig, PROXY_DOM_ID } from '@proxy/constant'; import { WidgetThemeService } from './otp/service/widget-theme.service'; -const REFERENCE_ID = '4512365o177529298869d0d23cc0453'; +const REFERENCE_ID = '4512365b177668815069e61c1692def'; const THEME: WidgetTheme = WidgetTheme.System; -const TYPE: PublicScriptType = PublicScriptType.UserManagement; -const AUTH_TOKEN = - 'cmtQRzJ4KzBwajJ4QS9vOVFMR1ZmamxLaGFGazlRcnpiOUM4NFhPWXdDZkRDV293T0VWV0tFV1NFbVlmVTE2WkRsUHFVUk5ybHREUHk2VjdLM2FDNFcybDF6MjJnOFY5MjNZTVdQVVVWVWVJTDJHakNHNFRadVJwWDRmUVZrakVCNVVTdGZhSVRadmlYVEZTS1FJZTl2cSsycUpaQVpCZ2JyYmoxVVBPYTI0bXpBLy9lUkozTTJTVU9XWUl6VjI4a3ZyVGlOajVmczkvK0VNc3hXa3Mzdz09'; +const TYPE: PublicScriptType = PublicScriptType.Authorization; +const AUTH_TOKEN = ''; @Component({ selector: 'proxy-root', @@ -62,30 +61,30 @@ export class AppComponent extends BaseComponent implements OnInit, OnDestroy { console.log('Failure reason:', error); }, }; - if (TYPE) { - widgetConfig['type'] = TYPE; + // if (TYPE) { + // widgetConfig['type'] = TYPE; - if (TYPE === PublicScriptType.Authorization) { - // Optional: Path to redirect after login (e.g., '/login') only used get proxy_auth_token in admin panel while preview - // widgetConfig['redirect_path'] = '/login'; - // Used to show Company details in the signup/registration form, default is true - // showCompanyDetails: false, - } else { - widgetConfig['authToken'] = AUTH_TOKEN; + // if (TYPE === PublicScriptType.Authorization) { + // // Optional: Path to redirect after login (e.g., '/login') only used get proxy_auth_token in admin panel while preview + // // widgetConfig['redirect_path'] = '/login'; + // // Used to show Company details in the signup/registration form, default is true + // // showCompanyDetails: false, + // } else { + // widgetConfig['authToken'] = AUTH_TOKEN; - if (TYPE === PublicScriptType.UserManagement) { - // Enables the Role & Permission tab in the User Management widget - widgetConfig['isRolePermission'] = false; - } + // if (TYPE === PublicScriptType.UserManagement) { + // // Enables the Role & Permission tab in the User Management widget + // widgetConfig['isRolePermission'] = false; + // } - // Note: Currently Subscription widget is not in use. - if (TYPE === PublicScriptType.Subscription) { - // Use in Subscription widget to redirect - // loginRedirectUrl: 'https://www.google.com', - // widgetConfig['isPreview'] = true; - } - } - } + // // Note: Currently Subscription widget is not in use. + // if (TYPE === PublicScriptType.Subscription) { + // // Use in Subscription widget to redirect + // // loginRedirectUrl: 'https://www.google.com', + // // widgetConfig['isPreview'] = true; + // } + // } + // } if (THEME) { widgetConfig['theme'] = THEME; } diff --git a/apps/36-blocks-widget/src/app/init-verification.ts b/apps/36-blocks-widget/src/app/init-verification.ts index 068be03f..05f7b746 100644 --- a/apps/36-blocks-widget/src/app/init-verification.ts +++ b/apps/36-blocks-widget/src/app/init-verification.ts @@ -50,13 +50,12 @@ function validateWidgetConfig(config: any): void { if (!window.initVerification) { window['initVerification'] = (config: any) => { - // Validate widget config and show error in console - validateWidgetConfig(config); - - // In case of no type, set default to Authorization + // Default before validation: referenceId-only / legacy embeds omit `type` (authorization login widget). if (!config?.type) { config = { ...config, type: PublicScriptType.Authorization }; } + validateWidgetConfig(config); + const initFn = () => { const urlParams = new URLSearchParams(window.location.search); const isRegisterFormOnlyFromParams = urlParams.get('isRegisterFormOnly') === 'true'; diff --git a/apps/36-blocks-widget/src/app/otp/component/login/login.component.html b/apps/36-blocks-widget/src/app/otp/component/login/login.component.html index 26f0beaf..371a7076 100644 --- a/apps/36-blocks-widget/src/app/otp/component/login/login.component.html +++ b/apps/36-blocks-widget/src/app/otp/component/login/login.component.html @@ -151,15 +151,17 @@

} Login -

- New User? - Create Account -

+ @if (!isCreateAccountTextAppended()) { +

+ New User? + Create Account +

+ } } diff --git a/apps/36-blocks-widget/src/app/otp/component/login/login.component.ts b/apps/36-blocks-widget/src/app/otp/component/login/login.component.ts index 6913985b..6dcb4e98 100644 --- a/apps/36-blocks-widget/src/app/otp/component/login/login.component.ts +++ b/apps/36-blocks-widget/src/app/otp/component/login/login.component.ts @@ -39,6 +39,7 @@ import { NgHcaptchaModule } from 'ng-hcaptcha'; }) export class LoginComponent extends BaseComponent implements OnInit, OnDestroy { public loginServiceData = input(); + public isCreateAccountTextAppended = input(false); public theme = input(); protected readonly WidgetTheme = WidgetTheme; private readonly themeService = inject(WidgetThemeService); diff --git a/apps/36-blocks-widget/src/app/otp/widget/widget.component.html b/apps/36-blocks-widget/src/app/otp/widget/widget.component.html index 1103bfd4..88435228 100644 --- a/apps/36-blocks-widget/src/app/otp/widget/widget.component.html +++ b/apps/36-blocks-widget/src/app/otp/widget/widget.component.html @@ -289,6 +289,7 @@

{{ showRegistration() ? 'Register' : 'Login' }}

{ - if (error?.status === 403) { + if (error?.status === 403 && this.isCreateAccountTextAppended) { this.setShowRegistration(true); this.show.set(true); this.registrationViaLogin = false; diff --git a/apps/36-blocks/src/app/panel/features/create-feature/create-feature.component.html b/apps/36-blocks/src/app/panel/features/create-feature/create-feature.component.html index a613af8e..9cca00ab 100644 --- a/apps/36-blocks/src/app/panel/features/create-feature/create-feature.component.html +++ b/apps/36-blocks/src/app/panel/features/create-feature/create-feature.component.html @@ -909,7 +909,7 @@

Are you a new user? {{ @@ -1120,7 +1120,7 @@

- @if (isEditMode && featureForm.get('primaryDetails.feature_id')?.value === 1) { + @@ -2213,7 +2213,7 @@

Taxes
@if (isEditMode) {
- Show Create Account for new user + Block new user sign-ups
- + @if (logInData$ | async; as user) {