Skip to content

Commit

Permalink
Ran /setup-env script to fix linting issues and
Browse files Browse the repository at this point in the history
package-lock.json files.
Updated shfmt.
  • Loading branch information
hawkishpolicy committed Apr 4, 2024
1 parent a030035 commit aca3fe6
Show file tree
Hide file tree
Showing 9 changed files with 23,588 additions and 23,591 deletions.
13,582 changes: 6,791 additions & 6,791 deletions backend/package-lock.json

Large diffs are not rendered by default.

29 changes: 11 additions & 18 deletions backend/src/api/users.ts
Original file line number Diff line number Diff line change
Expand Up @@ -262,9 +262,7 @@ const sendRSCInviteEmail = async (email: string) => {
'ReadySetCyber Dashboard Invitation',
`Hi there,
You've been invited to join ReadySetCyber Dashboard. To accept the invitation and start using your Dashboard, sign on at ${
process.env.FRONTEND_DOMAIN
}/readysetcyber/create-account.
You've been invited to join ReadySetCyber Dashboard. To accept the invitation and start using your Dashboard, sign on at ${process.env.FRONTEND_DOMAIN}/readysetcyber/create-account.
Crossfeed access instructions:
Expand All @@ -277,9 +275,7 @@ Crossfeed access instructions:
For more information on using Crossfeed, view the Crossfeed user guide at https://docs.crossfeed.cyber.dhs.gov/user-guide/quickstart/.
If you encounter any difficulties, please feel free to reply to this email (or send an email to ${
process.env.CROSSFEED_SUPPORT_EMAIL_REPLYTO
}).`
If you encounter any difficulties, please feel free to reply to this email (or send an email to ${process.env.CROSSFEED_SUPPORT_EMAIL_REPLYTO}).`
);
};
/**
Expand Down Expand Up @@ -939,9 +935,8 @@ export const RSCRegister = wrapHandler(async (event) => {
userType: UserType.READY_SET_CYBER,
invitePending: true
};

await connectToDatabase();

await connectToDatabase();

// Check if user already exists
let user = await User.findOne({
Expand All @@ -957,21 +952,19 @@ export const RSCRegister = wrapHandler(async (event) => {

// Create if user does not exist
if (!user) {

Check warning

Code scanning / CodeQL

Useless conditional Warning

This negation always evaluates to true.
user = await User.create(
newRSCUser
);
await User.save(user);
user = await User.create(newRSCUser);
await User.save(user);
// Send email notification
if (process.env.IS_LOCAL!) {
console.log('Cannot send invite email while running on local.');
} else {
await sendRSCInviteEmail(user.email);
}
if (process.env.IS_LOCAL!) {
console.log('Cannot send invite email while running on local.');
} else {
await sendRSCInviteEmail(user.email);
}
}

const savedUser = await User.findOne(user.id);
return {
statusCode: 200,
body: JSON.stringify(savedUser)
};
})
});
4 changes: 2 additions & 2 deletions backend/test/assessments.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { expect, test } from '@jest/globals';
test('dummy test', () => {
expect(true).toBe(true);
});
expect(true).toBe(true);
});
Loading

0 comments on commit aca3fe6

Please sign in to comment.