mirror of
https://github.com/HeyPuter/puter.git
synced 2026-05-29 21:01:27 +00:00
fix: ensure puter.signup emit resolves
This commit is contained in:
@@ -99,7 +99,11 @@ module.exports = eggspress(['/signup'], {
|
||||
body: req.body,
|
||||
};
|
||||
|
||||
await emitAsync('puter.signup', event);
|
||||
const MAX_WAIT = 5 * 1000;
|
||||
await Promise.race([
|
||||
emitAsync('puter.signup', event),
|
||||
new Promise(resolve => setTimeout(() => resolve(), MAX_WAIT)),
|
||||
])
|
||||
|
||||
if ( ! event.allow ) {
|
||||
return res.status(400).send(event.error ?? 'You are not allowed to sign up.');
|
||||
|
||||
Reference in New Issue
Block a user