fix: new user registration did not save
This commit is contained in:
@@ -17,7 +17,7 @@ if (!request_headers.query.registering ||
|
||||
ssid_sessions[socket.ssid].setSessionData("subscriber_contact_method", request_headers.query.subscriber_contact_method);
|
||||
ssid_sessions[socket.ssid].setSessionData("subscriber_userid", '1' + Math.floor(Math.random() * 1000000000000000000));
|
||||
ssid_sessions[socket.ssid].setSessionData("registered", true);
|
||||
if (!ssid_sessions[socket.ssid].storeSessionData()) {
|
||||
if (!ssid_sessions[socket.ssid].storeSessionData(true)) {
|
||||
var errpage = doErrorPage(400);
|
||||
headers = errpage[0];
|
||||
data = errpage[1];
|
||||
|
||||
@@ -189,7 +189,7 @@ class WTVClientSessionData {
|
||||
}
|
||||
}
|
||||
|
||||
saveSessionData() {
|
||||
saveSessionData(force_write = false) {
|
||||
if (this.isRegistered()) {
|
||||
// load data from disk and merge new data
|
||||
var temp_store = this.session_store;
|
||||
@@ -198,7 +198,8 @@ class WTVClientSessionData {
|
||||
temp_store = null;
|
||||
} else {
|
||||
// do not write file if user is not registered, return true because this is not an error
|
||||
return true;
|
||||
// force write needed to set the initial reg
|
||||
if (!force_write) return true;
|
||||
}
|
||||
|
||||
try {
|
||||
@@ -218,9 +219,9 @@ class WTVClientSessionData {
|
||||
return this.loadSessionData();
|
||||
}
|
||||
|
||||
storeSessionData() {
|
||||
storeSessionData(force_write = false) {
|
||||
// alias
|
||||
return this.saveSessionData();
|
||||
return this.saveSessionData(force_write);
|
||||
}
|
||||
|
||||
SaveIfRegistered() {
|
||||
|
||||
Reference in New Issue
Block a user