Skip to content

Node.js based forum software built for the modern web

fix: register abort can error on weird session state (#11854)

Oplikoc95119156db5
diff --git a/src/controllers/authentication.js b/src/controllers/authentication.js
index dcd9aa371f..58eff94299 100644
--- a/src/controllers/authentication.js
+++ b/src/controllers/authentication.js
@@ -210,7 +210,7 @@ authenticationController.registerComplete = async function (req, res) {
};
authenticationController.registerAbort = async (req, res) => {
- if (req.uid) {
+ if (req.uid && req.session.registration) {
// Email is the only cancelable interstitial
delete req.session.registration.updateEmail;