mirror of
https://github.com/HeyPuter/puter.git
synced 2026-11-16 10:46:59 +00:00
fix: ensure puter.signup emit resolves
This commit is contained in:
1 parent
ca9e74ece4
commit
113ed31336
1 file changed
+5
-1
@@ -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