Skip to content

fix: enforce auth on addClientLog call - #1284

Merged
janosbabik merged 3 commits into
developfrom
fix-addclientlog
Dec 10, 2025
Merged

fix: enforce auth on addClientLog call#1284
janosbabik merged 3 commits into
developfrom
fix-addclientlog

Conversation

@janosbabik

Copy link
Copy Markdown
Contributor

This PR enforces authentication for the addClientLog mutation on the backend and updates the frontend to handle authenticated logging in contexts where React hooks are unavailable.

@janosbabik
janosbabik requested a review from a team as a code owner December 4, 2025 13:05
@janosbabik
janosbabik requested review from Bhaswati1148, TCMeldrum and bolmsten and removed request for a team December 4, 2025 13:05

@TCMeldrum TCMeldrum left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good only minor question

errorMessage = 'Exception while preparing error message';
} finally {
getUnauthorizedApi().addClientLog({ error: errorMessage });
void sendClientLog(errorMessage, this.state.errorToken);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to void this function call?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It means the async call is intentionally not awaited. However using void or not does not change anything at runtime.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool thanks for clarifying

@jekabs-karklins jekabs-karklins left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question: I wonder if you have considered what happens when the call fails during the login, for example in apps/frontend/src/components/user/ExternalAuth.tsx when we call

const handleAuthorizationCode = (authorizationCode: string)

If this fails then we would not get a log.

I think we might weigh on the value of protecing this endpoint vs not getting 100% of the logs, and this might be justified to require the auth.

@janosbabik

Copy link
Copy Markdown
Contributor Author

question: I wonder if you have considered what happens when the call fails during the login, for example in apps/frontend/src/components/user/ExternalAuth.tsx when we call

const handleAuthorizationCode = (authorizationCode: string)

If this fails then we would not get a log.

I think we might weigh on the value of protecing this endpoint vs not getting 100% of the logs, and this might be justified to require the auth.

Do you mean the externalTokenLogin call inside the handleAuthorizationCode? If it fails, we receive an error from the backend, don’t we?

@janosbabik
janosbabik merged commit 00d73e7 into develop Dec 10, 2025
22 checks passed
@janosbabik
janosbabik deleted the fix-addclientlog branch December 10, 2025 11:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants