Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: expose restartOnError on all sdks RELEASE #838

Merged
merged 5 commits into from
Nov 13, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ export class DescopeComponent implements OnInit, OnChanges {
@Input() telemetryKey: string;
@Input() redirectUrl: string;
@Input() autoFocus: true | false | 'skipFirstScreen';
@Input() validateOnBlur: boolean;
@Input() restartOnError: boolean;

@Input() debug: boolean;
@Input() errorTransformer: (error: { text: string; type: string }) => string;
Expand Down Expand Up @@ -122,6 +124,12 @@ export class DescopeComponent implements OnInit, OnChanges {
if (this.autoFocus) {
this.webComponent.setAttribute('auto-focus', this.autoFocus.toString());
}
if (this.validateOnBlur) {
this.webComponent.setAttribute('validate-on-blur', this.autoFocus.toString());
}
if (this.restartOnError) {
this.webComponent.setAttribute('restart-on-error', this.autoFocus.toString());
}
if (this.debug) {
this.webComponent.setAttribute('debug', this.debug.toString());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
[telemetryKey]="telemetryKey"
[redirectUrl]="redirectUrl"
[autoFocus]="autoFocus"
[validateOnBlur]="validateOnBlur"
[restartOnError]="restartOnError"
[debug]="debug"
[errorTransformer]="errorTransformer"
[client]="client"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ export class SignInFlowComponent {
@Input() telemetryKey: string;
@Input() redirectUrl: string;
@Input() autoFocus: true | false | 'skipFirstScreen';

@Input() validateOnBlur: boolean;
@Input() restartOnError: boolean;

@Input() debug: boolean;
@Input() errorTransformer: (error: { text: string; type: string }) => string;
@Input() client: Record<string, any>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
[telemetryKey]="telemetryKey"
[redirectUrl]="redirectUrl"
[autoFocus]="autoFocus"
[validateOnBlur]="validateOnBlur"
[restartOnError]="restartOnError"
[debug]="debug"
[errorTransformer]="errorTransformer"
[client]="client"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ export class SignUpFlowComponent {
@Input() telemetryKey: string;
@Input() redirectUrl: string;
@Input() autoFocus: true | false | 'skipFirstScreen';

@Input() validateOnBlur: boolean;
@Input() restartOnError: boolean;

@Input() debug: boolean;
@Input() errorTransformer: (error: { text: string; type: string }) => string;
@Input() client: Record<string, any>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
[telemetryKey]="telemetryKey"
[redirectUrl]="redirectUrl"
[autoFocus]="autoFocus"
[validateOnBlur]="validateOnBlur"
[restartOnError]="restartOnError"
[debug]="debug"
[errorTransformer]="errorTransformer"
[client]="client"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ export class SignUpOrInFlowComponent {
@Input() telemetryKey: string;
@Input() redirectUrl: string;
@Input() autoFocus: true | false | 'skipFirstScreen';

@Input() validateOnBlur: boolean;
@Input() restartOnError: boolean;

@Input() debug: boolean;
@Input() errorTransformer: (error: { text: string; type: string }) => string;
@Input() client: Record<string, any>;
Expand Down
4 changes: 4 additions & 0 deletions packages/sdks/react-sdk/src/components/Descope.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ const DescopeWC = lazy(async () => {
styleId,
autoFocus,
validateOnBlur,
restartOnError,
storeLastAuthenticatedUser,
}) => (
<descope-wc
Expand All @@ -71,6 +72,7 @@ const DescopeWC = lazy(async () => {
redirect-url={redirectUrl}
auto-focus={autoFocus}
validate-on-blur={validateOnBlur}
restart-on-error={restartOnError}
store-last-authenticated-user={storeLastAuthenticatedUser}
/>
),
Expand All @@ -95,6 +97,7 @@ const Descope = React.forwardRef<HTMLElement, DescopeProps>(
redirectUrl,
autoFocus,
validateOnBlur,
restartOnError,
errorTransformer,
styleId,
},
Expand Down Expand Up @@ -217,6 +220,7 @@ const Descope = React.forwardRef<HTMLElement, DescopeProps>(
autoFocus={autoFocus}
styleId={styleId}
validateOnBlur={validateOnBlur}
restartOnError={restartOnError}
storeLastAuthenticatedUser={storeLastAuthenticatedUser}
keepLastAuthenticatedUserAfterLogout={
keepLastAuthenticatedUserAfterLogout
Expand Down
1 change: 1 addition & 0 deletions packages/sdks/react-sdk/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ export type DescopeProps = {
locale?: string;
autoFocus?: AutoFocusOptions;
validateOnBlur?: boolean;
restartOnError?: boolean;
debug?: boolean;
telemetryKey?: string;
redirectUrl?: string;
Expand Down
4 changes: 4 additions & 0 deletions packages/sdks/vue-sdk/src/Descope.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
:auto-focus="autoFocus"
:style-id="styleId"
:validate-on-blur="validateOnBlur"
:restart-on-error="restartOnError"
:store-last-authenticated-user="storeLastAuthenticatedUser"
:errorTransformer.prop="errorTransformer"
:form.attr="formStr"
Expand Down Expand Up @@ -85,6 +86,9 @@ const props = defineProps({
validateOnBlur: {
type: Boolean,
},
restartOnError: {
type: Boolean,
},
errorTransformer: {
type: Function,
},
Expand Down
Loading