idaa(recovery_meetings): sanitize Zoom encrypted passcode to avoid saving literal 'null' and normalize related fields

This commit is contained in:
Scott Idem
2026-03-23 14:23:29 -04:00
parent de8a016bda
commit a14320d9ed
4 changed files with 34 additions and 21 deletions

View File

@@ -154,9 +154,6 @@
<!-- <button
class="btn btn-sm variant-glass-secondary access_type_lock_btn hover:transition-all"
on:click={() => {
handle_clear_access();
}}
title="Access mode is currently enabled/unlocked. Click to exit and lock."
>
<span class="fas fa-lock mx-1"></span> Lock
@@ -260,9 +257,6 @@ class:justify-end={!expand} -->
<!-- <button
class="btn btn-sm variant-glass-secondary access_type_lock_btn hover:transition-all"
on:click={() => {
handle_clear_access();
}}
title="Access mode is currently enabled/unlocked. Click to exit and lock."
>
<span class="fas fa-lock mx-1"></span> Lock

View File

@@ -281,11 +281,7 @@
</strong>
</div>
<!-- {#if $ae_loc.trusted_access || $events_loc.launcher.trusted_access}
<button type="button" on:click={async () => {
show_modal_upload_files = true;
link_to_type = 'event_session';
link_to_id = $lq__event_session_obj.event_session_id;
}}
<button type="button"
type="button" class="ae_btn btn_outline_warning btn_xs" title="Upload updated or additional files"
>
<span class="fas fa-upload"></span> Upload Session File(s)

View File

@@ -286,10 +286,6 @@
<!-- {#if $events_loc.auth__person?.id}
<button type="button"
class="btn btn-sm variant-soft-warning"
on:click={() => {
sign_out();
alert('You have been signed out.');
}}
>
<span class="fas fa-times mx-1"></span>
Sign Out

View File

@@ -352,7 +352,11 @@
? event_meeting_fd.attend_url_passcode_enc
.replace(/[^a-zA-Z0-9]/g, '')
.trim()
: null;
: '';
// Defensive: prevent saving the literal strings 'null' or 'undefined'
if (zoom_passcode_enc === 'null' || zoom_passcode_enc === 'undefined') {
zoom_passcode_enc = '';
}
let zoom_url = event_meeting_fd.zoom_attend_url
? event_meeting_fd.zoom_attend_url.trim()
: null;
@@ -674,8 +678,15 @@ Copy and paste link: <a href="${link_base_url}?event_id=${event_do.event_id}">${
$idaa_slct.event_obj.attend_url_passcode =
String($idaa_slct.event_obj.attend_url_passcode).trim() ?? '';
$idaa_slct.event_obj.attend_json.zoom.passcode_enc =
String($idaa_slct.event_obj.attend_json.zoom.passcode_enc) ?? '';
// Normalize encrypted passcode: avoid String(null) -> 'null'
{
const _enc = $idaa_slct.event_obj.attend_json.zoom.passcode_enc;
if (_enc == null || _enc === 'null' || _enc === 'undefined') {
$idaa_slct.event_obj.attend_json.zoom.passcode_enc = '';
} else {
$idaa_slct.event_obj.attend_json.zoom.passcode_enc = String(_enc).trim();
}
}
$idaa_slct.event_obj.attend_json.zoom.domain = $idaa_slct.event_obj
.attend_json.zoom.domain
@@ -1127,16 +1138,25 @@ Copy and paste link: <a href="${link_base_url}?event_id=${event_do.event_id}">${
<label class="flex flex-col gap-1 text-sm font-semibold text-surface-700-300" for="attend_url_code">
Zoom Meeting ID <span class="text-error-500 ml-0.5">*</span>
<input
type="number"
type="text"
inputmode="numeric"
pattern="[0-9 ]*"
id="attend_url_code"
name="attend_url_code"
max="99999999999"
maxlength="20"
autocomplete="off"
required
placeholder="e.g. 123 456 7890"
bind:value={$idaa_slct.event_obj.attend_url_code}
onblur={() => {
// Strip all non-digits and update value immediately
if ($idaa_slct.event_obj.attend_url_code) {
$idaa_slct.event_obj.attend_url_code = String($idaa_slct.event_obj.attend_url_code).replace(/[^0-9]/g, '');
}
}}
onchange={() => {
if ($idaa_slct.event_obj.attend_url_code?.length > 8) {
// Also trigger update if length is sufficient
if ($idaa_slct.event_obj.attend_url_code?.replace(/[^0-9]/g, '').length > 8) {
$idaa_trig = 'update_zoom_full_url';
}
}}
@@ -1172,6 +1192,13 @@ Copy and paste link: <a href="${link_base_url}?event_id=${event_do.event_id}">${
autocomplete="off"
placeholder="Encrypted passcode from URL"
bind:value={$idaa_slct.event_obj.attend_json.zoom.passcode_enc}
onblur={() => {
// If value is null/undefined or literal 'null'/'undefined', set to empty string
const _v = $idaa_slct.event_obj.attend_json.zoom.passcode_enc;
if (_v == null || _v === 'null' || _v === 'undefined') {
$idaa_slct.event_obj.attend_json.zoom.passcode_enc = '';
}
}}
onchange={() => {
if ($idaa_slct.event_obj.attend_json.zoom.passcode_enc?.length >= 8) {
$idaa_trig = 'update_zoom_full_url';