Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
app.get('/join', nocache, async function(req, res) {
// if already signed in, skip
if(req.session.user)
res.redirect(req.query.r || '/')
req.session.joinCode = req.session.joinCode || uniqid()
res.render('join', {
user: req.session.user,
title: 'Join',
code: req.session.joinCode,
fail: req.session.joinFailWhy,
already: req.session.join || {},
project: signupProjectId != null,
csrfToken: req.csrfToken()
})
delete req.session.joinFailWhy
})
const uniqId = (props, dispatch) => {
if (props.token) {
console.log("using params: ", props.token)
dispatch(props.action, props.token)
} else {
console.log("generating uniqid")
const p = process("#")
window.location = window.location + p
dispatch(props.action, p)
}
}
export default (entityPrefix = '') => {
return uniqid.process(entityPrefix);
};