[FIXED] Corregir problema con el diálogo de token en cversadm_token.sh

- Reemplazar dialog_input_pass por llamada directa a dialog para mejor compatibilidad
- Usar --stdout para capturar correctamente la entrada del usuario
- Mejorar formato del cuadro de diálogo con dimensiones apropiadas (8x60)
- Mantener validaciones mientras se soluciona el problema de entrada en blanco

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Mauro Rosero P. 2025-03-15 13:44:15 -05:00
parent fdc8d6b826
commit c4b8bfa639
Signed by: mrosero
GPG key ID: 83BD2A5F674B7E26

View file

@ -118,32 +118,33 @@ request_token() {
"forgejo") platform_name="${cvmsg_012}" ;; "forgejo") platform_name="${cvmsg_012}" ;;
esac esac
# Bucle para validación de token # Bucle para validación de token usando dialog directamente
while true; do while true; do
dialog_input_pass "${cvmsg_003}" "${cvmsg_004} $platform_name # Usar dialog directamente en lugar de dialog_input_pass
${cvmsg_005}" token=$(dialog --backtitle "$title" --stdout --title "${cvmsg_003}" \
--passwordbox "${cvmsg_004} $platform_name\n${cvmsg_005}" 8 60)
if [ $codex -ne 0 ]; then # Verificar si el usuario canceló
if [ $? -ne 0 ]; then
clear
return 1 return 1
fi fi
token="$value"
# Validar token # Validar token
if [ -z "$token" ]; then if [ -z "$token" ]; then
dialog_error_box "${head_error}" "${cvmsg_015}" dialog --backtitle "$title" --title "${head_error}" --msgbox "${cvmsg_015}" 7 60
continue continue
fi fi
# Verificar longitud (debería tener al menos 30 caracteres) # Verificar longitud (debería tener al menos 30 caracteres)
if [ ${#token} -lt 30 ]; then if [ ${#token} -lt 30 ]; then
dialog_error_box "${head_error}" "${cvmsg_016}" dialog --backtitle "$title" --title "${head_error}" --msgbox "${cvmsg_016}" 7 60
continue continue
fi fi
# Verificar formato (debería contener caracteres alfanuméricos y algunos especiales) # Verificar formato (debería contener caracteres alfanuméricos y algunos especiales)
if ! [[ "$token" =~ ^[A-Za-z0-9\#\-\_\.]+$ ]]; then if ! [[ "$token" =~ ^[A-Za-z0-9\#\-\_\.]+$ ]]; then
dialog_error_box "${head_warning}" "${cvmsg_017}" dialog --backtitle "$title" --title "${head_warning}" --msgbox "${cvmsg_017}" 7 60
fi fi
# Token válido # Token válido