fix login, probably break 5 other things

This commit is contained in:
zefie
2022-02-16 20:07:35 -05:00
parent 2a526c0702
commit 0a00e34537
6 changed files with 32 additions and 20 deletions

View File

@@ -46,20 +46,20 @@ wtv-visit: client:hangupphone`
}
}
if (user_id && !request_headers.query.initial_login && !request_headers.query.user_login) {
if (user_id != null && !request_headers.query.initial_login && !request_headers.query.user_login) {
if (request_headers.query.password == "") {
headers = `500 Please enter your password and try again
headers = `403 Please enter your password and try again
minisrv-no-mail-count: true
`;
} else if (ssid_sessions[socket.ssid].validateUserPassword(request_headers.query.password)) {
ssid_sessions[socket.ssid].setSessionData('password_valid', true)
ssid_sessions[socket.ssid].setUserLoggedIn(true);
headers = `200 OK
minisrv-no-mail-count: true
Content-Type: text/html
wtv-visit: ${gourl}
`;
} else {
headers = `500 The password you entered was incorrect. Please retype it and try again.
headers = `403 The password you entered was incorrect. Please retype it and try again.
minisrv-no-mail-count: true
`;
}