fix: webhook process (#45385)

* fix: token rework functional

fix: clean up

fix: more clean up

fix: more clean up

fix: add widget back to settings

fix:

fix:

fix: cypress

Apply suggestions from code review

Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>

fix: use flash enum

* chore: rename webhookToken -> userToken

fix: add translations I forgot to save

* fix: add missing tones for flash messages

* fix: node test
This commit is contained in:
Tom
2022-03-11 15:58:23 -06:00
committed by GitHub
parent 692605de3a
commit 9e5f9b2a7c
24 changed files with 370 additions and 434 deletions

View File

@ -153,7 +153,20 @@ MongoClient.connect(MONGOHQ_URL, { useNewUrlParser: true }, (err, client) => {
const db = client.db('freecodecamp');
const user = db.collection('user');
const dropUserTokens = async function () {
await db.collection('UserToken').deleteMany({
userId: {
$in: [
ObjectId('5fa2db00a25c1c1fa49ce067'),
ObjectId('5bd30e0f1caf6ac3ddddddb5'),
ObjectId('5bd30e0f1caf6ac3ddddddb9')
]
}
});
};
if (process.argv[2] === 'certUser') {
dropUserTokens();
user.deleteMany(
{
_id: {
@ -179,6 +192,7 @@ MongoClient.connect(MONGOHQ_URL, { useNewUrlParser: true }, (err, client) => {
}
);
} else {
dropUserTokens();
user.deleteMany(
{
_id: {