Skip to content

Commit

Permalink
test: migrate human callback tests part one
Browse files Browse the repository at this point in the history
  • Loading branch information
durran committed Apr 27, 2024
1 parent 34ac057 commit dd13b9f
Show file tree
Hide file tree
Showing 3 changed files with 640 additions and 361 deletions.
2 changes: 1 addition & 1 deletion .evergreen/run-oidc-prose-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
set -o errexit # Exit the script with error if any of the commands fail
set -o xtrace # Write all commands first to stderr

ENVIRONMENT=${ENVIRONMENT:-"aws"}
ENVIRONMENT=${ENVIRONMENT:-"test"}
PROJECT_DIRECTORY=${PROJECT_DIRECTORY:-"."}
source "${PROJECT_DIRECTORY}/.evergreen/init-node-and-npm-env.sh"

Expand Down
3 changes: 3 additions & 0 deletions src/cmap/auth/mongodb_oidc/automated_callback_workflow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,15 @@ export class AutomatedCallbackWorkflow extends CallbackWorkflow {
let tokenEntry: TokenEntry;
if (cache?.hasToken()) {
tokenEntry = cache.get();
console.log(tokenEntry);
try {
return await this.finishAuthentication(
connection,
credentials,
tokenEntry.idpServerResponse
);
} catch (error) {
console.log(error);
if (error.code === 18) {
cache?.remove();
return await this.oneStepAuth(connection, credentials, callback, cache);
Expand All @@ -46,6 +48,7 @@ export class AutomatedCallbackWorkflow extends CallbackWorkflow {
}
}
}
console.log('no token, one step');
return await this.oneStepAuth(connection, credentials, callback, cache);
}
}
Expand Down

0 comments on commit dd13b9f

Please sign in to comment.