Skip to content

Commit

Permalink
fix: metrics that were missing or werent firing
Browse files Browse the repository at this point in the history
  • Loading branch information
coldlink committed Jan 30, 2025
1 parent 9b556af commit 5715078
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 12 deletions.
15 changes: 3 additions & 12 deletions src/server/controllers/signInControllers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -487,13 +487,9 @@ export const oktaIdxApiSignInController = async ({
});

// if the user has made it here, they've successfully authenticated
// with a password
trackMetric('OktaIdxSignIn::Success');

// if the usePasscodeSignInFlag is set, but we're at this point, then the user has signed in with a password instead
// so we want to track that case user's take that action
if (usePasscode) {
trackMetric('OktaPasswordSignInFlow::Success');
}
trackMetric('OktaPasswordSignInFlow::Success');

// check the response from the challenge/answer endpoint
// if not a "CompleteLoginResponse" then Okta is in the state
Expand Down Expand Up @@ -616,12 +612,7 @@ export const oktaIdxApiSignInController = async ({
logger.error('Okta oktaIdxApiSignInController failed', error);

trackMetric('OktaIdxSignIn::Failure');

// if the usePasscode is set, but we're at this point, then the we've failed to send the user a passcode
// so we want to track that case
if (usePasscode) {
trackMetric('OktaPasswordSignInFlow::Failure');
}
trackMetric('OktaPasswordSignInFlow::Failure');

const { status, gatewayError } = oktaSignInControllerErrorHandler(error);

Expand Down
4 changes: 4 additions & 0 deletions src/server/routes/oauth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -731,6 +731,10 @@ router.get(
},
);

// basic checks successful, so track the success metric
// before handing off to the specific handler
trackMetric('OAuthAuthorization::Success');

// call the appropriate handler depending on the callbackParam
switch (req.params.callbackParam) {
case 'application-callback':
Expand Down

0 comments on commit 5715078

Please sign in to comment.