routes/repeatNotification.ts
/*
* Copyright (c) 2014-2024 Bjoern Kimminich & the OWASP Juice Shop contributors.
* SPDX-License-Identifier: MIT
*/
import challengeUtils = require('../lib/challengeUtils')
import { type Request, type Response } from 'express'
module.exports = function repeatNotification () {
return ({ query }: Request, res: Response) => {
const challengeName: string = decodeURIComponent(query.challenge as string)
const challenge = challengeUtils.findChallengeByName(challengeName)
if (challenge?.solved) {
challengeUtils.sendNotification(challenge, true)
}
res.sendStatus(200)
}
}