Skip to content

PM-460 - handle scurity scan issues #984

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

Merged
merged 1 commit into from
Jan 7, 2025
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion src/apps/earn/src/config/dev.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const DevEarnConfig: EarnConfig = {
/* Max number of recommended challenges */
CHALLENGE_DETAILS_MAX_NUMBER_RECOMMENDED_CHALLENGES: 3,

SERVER_API_KEY: '79b2d5eb-c1fd-42c4-9391-6b2c9780d591',
SERVER_API_KEY: process.env.REACT_APP_LOG_SERVER_API_KEY as string,

API: {
V2: 'https://api.topcoder-dev.com/v2',
Expand Down
2 changes: 1 addition & 1 deletion src/apps/earn/src/config/prod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const ProdEarnConfig: EarnConfig = {
/**
* URL of Topcoder Connect Website
*/
SERVER_API_KEY: 'aa9ccf36-3936-450c-9983-097ddba51bef',
SERVER_API_KEY: process.env.REACT_APP_LOG_SERVER_API_KEY as string,
API: {
V2: 'https://api.topcoder-dev.com/v2',
V3: 'https://api.topcoder-dev.com/v3',
Expand Down
4 changes: 4 additions & 0 deletions src/apps/earn/src/utils/logger.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ _.functions(console).forEach((func) => {
let leLogger;

const log = (type, ...rest) => {
if (!config.SERVER_API_KEY) {
return;
}

fetch("/community-app-assets/api/logger", {
body: JSON.stringify({
data: rest,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { Dispatch, FC, SetStateAction, useEffect, useState } from 'react'

import { EnvironmentConfig } from '~/config'
import { BaseModal, Button } from '~/libs/ui'
import { preventDefault } from '~/apps/earn/src/utils/misc'

import styles from './DiceModal.module.scss'

Expand Down Expand Up @@ -49,7 +50,7 @@ const DiceModal: FC<DiceModalProps> = (props: DiceModalProps) => {
click below to refresh your settings.
</p>
<p className={styles.buttonContainer}>
<a href={window.location.href}>
<a href='#refresh-settings' onClick={preventDefault}>
<Button
secondary
label='Refresh Settings'
Expand Down
2 changes: 1 addition & 1 deletion src/apps/learn/src/free-code-camp/fcc-frame/FccFrame.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const FccFrame: FC<FccFrameProps> = (props: FccFrameProps) => {
frameRef.current.contentWindow.postMessage(JSON.stringify({
data: { path: `/${lessonUrl}` },
event: 'fcc:url:update',
}), '*')
}), LearnConfig.CLIENT)
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const WorkDetailDetailsSidebar: FC<{}> = () => {
<h4>supporting information</h4>
<a
className={styles.link}
href={window.location.href}
href='#1'
onClick={getClickHandler(setIsOrderContractModalOpen)}
rel='noopener noreferrer'
role='button'
Expand All @@ -50,7 +50,7 @@ const WorkDetailDetailsSidebar: FC<{}> = () => {
</a>
<a
className={styles.link}
href={window.location.href}
href='#2'
onClick={getClickHandler(setIsPrivacyPolicyModalOpen)}
rel='noopener noreferrer'
role='button'
Expand All @@ -60,7 +60,7 @@ const WorkDetailDetailsSidebar: FC<{}> = () => {
</a>
<a
className={styles.link}
href={window.location.href}
href='#3'
onClick={getClickHandler(setIsTermsModalOpen)}
rel='noopener noreferrer'
role='button'
Expand Down