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

oidc-signin-tool: log signin retries #256

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 commits
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
6 changes: 3 additions & 3 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@
"eslint.format.enable": true,
"eslint.lintTask.enable": true,
"editor.codeActionsOnSave": {
"source.fixAll.markdownlint": true, // first run the markdown linter
"editor.action.fixAll": true, // Run the default formatter before eslint, it handles whitespace better
"source.fixAll.eslint": true // then run ESLint auto-fix
"source.fixAll.markdownlint": "explicit",
"editor.action.fixAll": "explicit",
"source.fixAll.eslint": "explicit"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "log signin retries",
"packageName": "@itwin/oidc-signin-tool",
"email": "[email protected]",
"dependentChangeType": "patch"
}
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,6 @@
"beachball": "^2.43.1",
"lage": "^2.7.18",
"process": "^0.11.10"
}
},
"packageManager": "[email protected]+sha512.0a203ffaed5a3f63242cd064c8fb5892366c103e328079318f78062f24ea8c9d50bc6a47aa3567cabefd824d170e78fa2745ed1f16b132e16436146b7688f19b"
}
1 change: 0 additions & 1 deletion packages/oidc-signin-tool/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
"@itwin/core-common": "^3.3.0 || ^4.0.0",
"@itwin/service-authorization": "workspace:^",
"@playwright/test": "~1.41.0",
"crypto-browserify": "^3.12.0",
"dotenv": "^10.0.0",
"dotenv-expand": "^5.1.0",
"oidc-client-ts": "^2.4.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ export class TestBrowserAuthorizationClient implements AuthorizationClient {
try {
await this.signIn();
} catch (err) {
console.log("Error signing in", err);
// rethrow error if hit max number of retries or if it's not a navigation failure (i.e. a flaky failure)
if (
numRetries === 2 ||
Expand All @@ -90,6 +91,7 @@ export class TestBrowserAuthorizationClient implements AuthorizationClient {
)
throw err;
numRetries++;
console.log("Retrying sign in");
continue;
}

Expand Down Expand Up @@ -149,9 +151,9 @@ export class TestBrowserAuthorizationClient implements AuthorizationClient {
resultFromCallback: async (callbackUrl) => {
const tokenSet = await oidcClient.processSigninResponse(callbackUrl);
this._accessToken = `Bearer ${tokenSet.access_token}`,
this._expiresAt = tokenSet.expires_at !== undefined
? new Date(tokenSet.expires_at * 1000)
: undefined;
this._expiresAt = tokenSet.expires_at !== undefined
? new Date(tokenSet.expires_at * 1000)
: undefined;
},
});
}
Expand Down
Loading
Loading