diff --git a/backend/src/api/app.ts b/backend/src/api/app.ts index 8b260287..63f613d4 100644 --- a/backend/src/api/app.ts +++ b/backend/src/api/app.ts @@ -179,9 +179,6 @@ app.post('/auth/okta-callback', async (req, res) => { const clientId = process.env.REACT_APP_COGNITO_CLIENT_ID; const callbackUrl = process.env.REACT_APP_COGNITO_CALLBACK_URL; const domain = process.env.REACT_APP_COGNITO_DOMAIN; - console.log('Okta ClientID: ', clientId); - console.log('Okta CallbackURL: ', callbackUrl); - console.log('Okta Domain: ', domain); if (!code) { return res.status(400).json({ message: 'Missing authorization code' }); @@ -202,7 +199,6 @@ app.post('/auth/okta-callback', async (req, res) => { }, body: tokenData }); - console.log('Okta token response: ', response); const { id_token, access_token, refresh_token } = await response.json(); if (!id_token) { @@ -216,12 +212,6 @@ app.post('/auth/okta-callback', async (req, res) => { const cognitoUsername = decodedToken['cognito:username']; const oktaId = decodedToken['custom:OKTA_ID']; - console.log('Cognito Username:', cognitoUsername); - console.log('Cognito OKTA_ID:', oktaId); - - console.log('ID Token:', id_token); - console.log('Decoded Token:', decodedToken); - jwt.verify( id_token, auth.getOktaKey, diff --git a/backend/src/api/auth.ts b/backend/src/api/auth.ts index 575708ff..a40356e8 100644 --- a/backend/src/api/auth.ts +++ b/backend/src/api/auth.ts @@ -166,7 +166,6 @@ export const callback = async (event, context) => { user.loginBlockedByMaintenance = loginBlocked; user.save(); } - console.log(user); // If user does not exist, create it if (!user) { diff --git a/backend/src/api/helpers.ts b/backend/src/api/helpers.ts index dcf34a04..1183cbae 100644 --- a/backend/src/api/helpers.ts +++ b/backend/src/api/helpers.ts @@ -313,7 +313,6 @@ export const sendRegistrationApprovedEmail = async ( */ async function isMajorActiveMaintenance(): Promise { const now = new Date(); - console.log(now); try { // DB connection await connectToDatabase(); diff --git a/backend/src/api/notifications.ts b/backend/src/api/notifications.ts index 3a252386..a9dc8070 100644 --- a/backend/src/api/notifications.ts +++ b/backend/src/api/notifications.ts @@ -4,6 +4,18 @@ import { validateBody, wrapHandler, NotFound, Unauthorized } from './helpers'; import { isGlobalWriteAdmin } from './auth'; import S3Client from '../tasks/s3-client'; +// 508 Warning Banner S3 filename +const bannerFileName = '508warningtext.txt'; + +// Default 508 Warning Banner for local dev +const default508Banner = + 'CISA is committed to providing access for all individuals with disabilities, \ + including members of the public and all employees. While this website is not \ + yet fully accessible to users with disabilities as required by Section \ + [508](https://cisa.gov/accessibility) federal law, CISA is working diligently \ + to resolve those issues. If you experience accessibility issues, please email \ + [TOC@mail.cisa.dhs.gov](mailto:TOC@mail.cisa.dhs.gov) for assistance.'; + class NewNotification { @IsDateString() startDatetime?: string; @@ -99,8 +111,6 @@ export const list = wrapHandler(async (event) => { } }); - console.log('Notification.find result: ', result); - return { statusCode: 200, body: JSON.stringify(result) @@ -161,16 +171,28 @@ export const update = wrapHandler(async (event) => { * - Notifications */ export const get508Banner = wrapHandler(async () => { - const bannerFileName = '508warningtext.txt'; + // Return hardcoded banner for local builds + if (process.env.IS_LOCAL) { + console.log('Using default banner for 508 warning: ', default508Banner); + // API Response + return { + statusCode: 200, + body: JSON.stringify(default508Banner) + }; + } + + // Handle normal S3 logic try { const client = new S3Client(); const bannerResult = await client.getEmailAsset(bannerFileName); + // API Response return { statusCode: 200, body: JSON.stringify(bannerResult) }; } catch (error) { console.log('S3 Banner Error: ', error); + // API Error Response return { statusCode: 500, body: 'Error retrieving file from S3. See details in logs.'