Skip to content

Commit 86faf01

Browse files
authored
Revert "Releng: Revving up to version(s) 7.43.0 for artifact(s) okta-… (#3969)
OKTA-1120092 Revert "Releng: Revving up to version(s) 7.43.0 fo This reverts commit f2f6982. Revert "OKTA-938817: ov polling fix (#3916)" This reverts commit aeb0fa8.
1 parent f2f6982 commit 86faf01

12 files changed

Lines changed: 94 additions & 543 deletions

File tree

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ build2
99
.widgetrc
1010
.widgetrc.js
1111
.vscode
12-
!.vscode/launch.json
1312
.DS_Store
1413
*.iml
1514
.idea

.testcaferc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ const config = {
124124
: (env.OKTA_SIW_EN_LEAKS ? 2 : 4),
125125

126126
// retry failed tests
127-
quarantineMode: (env.OKTA_SIW_EN_LEAKS || !env.CI) ? false : {
127+
quarantineMode: env.OKTA_SIW_EN_LEAKS ? false : {
128128
successThreshold: 1,
129129
attemptLimit: 5,
130130
},

.vscode/launch.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"request": "launch",
1010
"name": "Debug with Jest",
1111
"program": "${workspaceFolder}/node_modules/jest/bin/jest",
12-
"runtimeExecutable": "${env:HOME}/.nvm/versions/node/v16.18.1/bin/node",
12+
"runtimeExecutable": "${env:HOME}/.nvm/versions/node/v14.18.3/bin/node",
1313
"args": [
1414
"--runInBand",
1515
"--no-cache",
@@ -26,7 +26,7 @@
2626
"request": "launch",
2727
"name": "Debug with TestCafe",
2828
"program": "${workspaceRoot}/node_modules/testcafe/bin/testcafe.js",
29-
"runtimeExecutable": "${env:HOME}/.nvm/versions/node/v16.18.1/bin/node",
29+
"runtimeExecutable": "${env:HOME}/.nvm/versions/node/v14.18.3/bin/node",
3030
"args": [
3131
"chrome",
3232
"${relativeFile}",
@@ -44,7 +44,7 @@
4444
"request": "launch",
4545
"name": "Debug v3 Parity with TestCafe",
4646
"program": "${workspaceRoot}/node_modules/testcafe/bin/testcafe.js",
47-
"runtimeExecutable": "${env:HOME}/.nvm/versions/node/v16.18.1/bin/node",
47+
"runtimeExecutable": "${env:HOME}/.nvm/versions/node/v14.18.3/bin/node",
4848
"env": {
4949
"OKTA_SIW_GEN3": "true"
5050
},
@@ -66,7 +66,7 @@
6666
"request": "launch",
6767
"name": "Debug with WebdriverIO",
6868
"program": "${workspaceRoot}/test/e2e/node_modules/@wdio/cli/bin/wdio.js",
69-
"runtimeExecutable": "${env:HOME}/.nvm/versions/node/v16.18.1/bin/node",
69+
"runtimeExecutable": "${env:HOME}/.nvm/versions/node/v14.18.3/bin/node",
7070
"args": [
7171
"${workspaceRoot}/test/e2e/wdio.conf.js",
7272
"--spec",
@@ -84,7 +84,7 @@
8484
"request": "launch",
8585
"name": "Cucumber Tests Debug with WebdriverIO",
8686
"program": "${workspaceRoot}/test/e2e/node_modules/@wdio/cli/bin/wdio.js",
87-
"runtimeExecutable": "${env:HOME}/.nvm/versions/node/v16.18.1/bin/node",
87+
"runtimeExecutable": "${env:HOME}/.nvm/versions/node/v14.18.3/bin/node",
8888
"args": [
8989
"${workspaceRoot}/test/e2e/cucumber.wdio.conf.ts",
9090
"--spec",

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"private": true,
33
"name": "@okta/okta-signin-widget",
44
"description": "The Okta Sign-In Widget",
5-
"version": "7.43.0",
5+
"version": "7.42.0",
66
"homepage": "https://github.com/okta/okta-signin-widget",
77
"license": "Apache-2.0",
88
"repository": {

playground/mocks/config/test-configs/OVAuthenticatorEmailEnrollOnSignOnSameDeviceEnrollmentDisabled.js

Lines changed: 0 additions & 23 deletions
This file was deleted.

playground/mocks/config/test-configs/index.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,5 @@ module.exports = {
2222
WidgetCustomization: require('./WidgetCustomization'),
2323
EnrollAuthenticatorEmail: require('./EnrollAuthenticatorEmail'),
2424
UserUnlockAccountLandingApp: require('./UserUnlockAccountLandingApp'),
25-
DeviceCodeActivate: require('./DeviceCodeActivate'),
26-
OVAuthenticatorEmailEnrollOnSignOnSameDeviceEnrollmentDisabled:
27-
require('./OVAuthenticatorEmailEnrollOnSignOnSameDeviceEnrollmentDisabled'),
25+
DeviceCodeActivate: require('./DeviceCodeActivate')
2826
};

src/v3/src/components/LoopbackProbe/LoopbackProbe.tsx

Lines changed: 7 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -29,43 +29,23 @@ const LoopbackProbe: FunctionComponent<{ uischema: LoopbackProbeElement }> = ({
2929
},
3030
}) => {
3131
const widgetContext = useWidgetContext();
32-
const {
33-
authClient,
34-
pollingTransaction,
35-
idxTransaction,
36-
setIdxTransaction,
37-
} = widgetContext;
38-
39-
// Use pollingTransaction if available to get latest challengeRequest during active polling
40-
// Fall back to idxTransaction for initial state
41-
const activeTransaction = pollingTransaction || idxTransaction;
42-
43-
// Extract fresh deviceChallengePayload from active transaction using same logic as transformer
44-
// This ensures we respond to new challenges during continuous polling
45-
const liveDeviceChallengePayload = activeTransaction?.nextStep?.name === 'device-challenge-poll'
46-
? activeTransaction.nextStep?.relatesTo?.value
47-
// @ts-expect-error challenge is not defined on contextualData
48-
: activeTransaction?.nextStep?.relatesTo?.value?.contextualData?.challenge?.value;
49-
50-
// Use static config from initial deviceChallengePayload (doesn't change during polling)
32+
const { authClient, idxTransaction, setIdxTransaction } = widgetContext;
33+
5134
const probeTimeoutMillis: number = typeof deviceChallengePayload.probeTimeoutMillis === 'undefined'
5235
? 100 : deviceChallengePayload.probeTimeoutMillis;
5336
const ports: string[] = deviceChallengePayload.ports || [];
5437
const {
5538
domain,
5639
httpsDomain,
40+
challengeRequest,
5741
} = deviceChallengePayload;
5842

59-
// Get latest challengeRequest from live transaction, fall back to initial value
60-
const challengeRequest = liveDeviceChallengePayload?.challengeRequest
61-
|| deviceChallengePayload.challengeRequest;
62-
6343
const submitHandler = async (stepName: string) => {
6444
const payload: IdxActionParams = {
6545
step: stepName,
6646
};
67-
if (typeof activeTransaction?.context.stateHandle !== 'undefined') {
68-
payload.stateHandle = activeTransaction.context.stateHandle;
47+
if (typeof idxTransaction?.context.stateHandle !== 'undefined') {
48+
payload.stateHandle = idxTransaction.context.stateHandle;
6949
}
7050
const newTransaction = await authClient?.idx.proceed(payload);
7151
setIdxTransaction(newTransaction);
@@ -78,8 +58,8 @@ const LoopbackProbe: FunctionComponent<{ uischema: LoopbackProbeElement }> = ({
7858
params,
7959
}],
8060
};
81-
if (typeof activeTransaction?.context.stateHandle !== 'undefined') {
82-
payload.stateHandle = activeTransaction.context.stateHandle;
61+
if (typeof idxTransaction?.context.stateHandle !== 'undefined') {
62+
payload.stateHandle = idxTransaction.context.stateHandle;
8363
}
8464
const newTransaction = await authClient?.idx.proceed(payload);
8565
setIdxTransaction(newTransaction);

src/v3/src/components/Widget/index.tsx

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -123,10 +123,7 @@ export const Widget: FunctionComponent<WidgetProps> = (widgetProps) => {
123123
const [stepToRender, setStepToRender] = useState<string | undefined>(undefined);
124124
const prevIdxTransactionRef = useRef<IdxTransaction>();
125125
const [responseError, setResponseError] = useState<AuthApiError | OAuthError | null>(null);
126-
const [
127-
pollingTransaction,
128-
stablePollingTransaction,
129-
] = usePolling(idxTransaction, widgetProps, {});
126+
const pollingTransaction = usePolling(idxTransaction, widgetProps, data);
130127
const interactionCodeFlowFormBag = useInteractionCodeFlow(
131128
idxTransaction,
132129
widgetProps,
@@ -419,7 +416,7 @@ export const Widget: FunctionComponent<WidgetProps> = (widgetProps) => {
419416

420417
// Update idxTransaction when new status comes back from polling
421418
useEffect(() => {
422-
if (!idxTransaction || !stablePollingTransaction) {
419+
if (!idxTransaction || !pollingTransaction) {
423420
return;
424421
}
425422

@@ -431,11 +428,11 @@ export const Widget: FunctionComponent<WidgetProps> = (widgetProps) => {
431428
* But if for some reason the keys are the same between them, we perform a last ditch check
432429
* against the current authenticator's ID, which should always be unique between challenges
433430
*/
434-
if (!areTransactionsEqual(idxTransaction, stablePollingTransaction)) {
435-
setIdxTransaction(stablePollingTransaction);
431+
if (!areTransactionsEqual(idxTransaction, pollingTransaction)) {
432+
setIdxTransaction(pollingTransaction);
436433
}
437434
// eslint-disable-next-line react-hooks/exhaustive-deps
438-
}, [stablePollingTransaction, idxTransaction]); // watch both transactions
435+
}, [pollingTransaction]); // only watch on pollingTransaction changes
439436

440437
useEffect(() => {
441438
if (typeof interactionCodeFlowFormBag === 'undefined') {
@@ -511,7 +508,6 @@ export const Widget: FunctionComponent<WidgetProps> = (widgetProps) => {
511508
onSuccessCallback: globalSuccessFn,
512509
onErrorCallback: globalErrorFn,
513510
idxTransaction,
514-
pollingTransaction,
515511
setResponseError,
516512
setIdxTransaction,
517513
setIsClientTransaction,

0 commit comments

Comments
 (0)