From d9b7be34b1fff7794ba2d296c43308e6171f4d0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jorem=20Ju=C3=A1rez?= Date: Mon, 14 Sep 2026 17:12:27 -0600 Subject: [PATCH] La llave de acceso sale de todas las pantallas MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Se revierte la decisión de conservar el bloque de auth_passkey en el inicio de sesión («it is restyled, not dropped»), y se cierran también el resto de las puertas visibles: - Inicio de sesión: replace vacío sobre el `t-call="web.login_oauth"` de web.login, que es quien dibuja el «- o -» y el botón; el bloque no está en el arch de web.login y un xpath sobre él no engancharía. - Alta y restablecer contraseña (y cualquier página que llame a web.login_oauth): fuera las tres líneas con que auth_passkey añade su botón a `auth_btns`; con la lista vacía el t-if del core se lleva el separador. - Ficha del usuario y preferencias: la sección «Llaves de acceso». - Asistente de confirmar identidad: el modo llave y su botón. Además el asistente ya no ARRANCA en ese modo: auth_passkey lo pone por defecto a quien tiene una llave, con la contraseña oculta y la salida dentro del bloque retirado; sin esto abría una hoja en blanco. - Portal /my/security: la tabla de llaves y su «Agregar» (beyond_attendance_qr). Todo con replace vacío y prioridad 99, para correr después de las herencias de auth_passkey sea cual sea el orden de instalación. Por eso beyond_base depende ahora de auth_passkey y beyond_attendance_qr de auth_passkey_portal: los nodos que se quitan son suyos. Solo se esconden las puertas: las llaves registradas NO se borran y los módulos siguen instalados. Devolverlas es quitar los xpaths y el método por defecto; views/passkey_templates.xml los lista. El servidor sigue aceptando un inicio de sesión con llave si alguien lo envía a mano. El SCSS del login pierde las reglas que vestían el bloque, ya huérfanas. Sin pruebas nuevas. Verificado instalando los nueve módulos en una base desechable —todos los xpaths enganchan, sin errores de vista ni de assets— y revisando cada puerta ahí: ningún nodo de llave, y a un usuario con llave registrada el asistente le pide contraseña (la capa de auth_passkey sola pediría la llave). pruebas.sh beyond_base: los mismos 2 rojos que en main. Co-Authored-By: Claude Opus 5 (1M context) --- addons/beyond_attendance_qr/__manifest__.py | 2 +- .../views/portal_templates.xml | 10 +++ addons/beyond_base/__manifest__.py | 3 +- addons/beyond_base/models/__init__.py | 1 + .../models/res_users_identitycheck.py | 19 +++++ .../static/src/login/beyond_login.scss | 84 ++----------------- addons/beyond_base/views/login_templates.xml | 24 ++++-- .../beyond_base/views/passkey_templates.xml | 67 +++++++++++++++ 8 files changed, 125 insertions(+), 85 deletions(-) create mode 100644 addons/beyond_base/models/res_users_identitycheck.py create mode 100644 addons/beyond_base/views/passkey_templates.xml diff --git a/addons/beyond_attendance_qr/__manifest__.py b/addons/beyond_attendance_qr/__manifest__.py index d1b22f6..02d0e0d 100644 --- a/addons/beyond_attendance_qr/__manifest__.py +++ b/addons/beyond_attendance_qr/__manifest__.py @@ -20,7 +20,7 @@ calcada del sistema Taboada de Collina: 'category': 'Beyond', 'author': 'Collina Systems', 'license': 'Other proprietary', - 'depends': ['beyond_branch', 'hr_attendance', 'portal'], + 'depends': ['beyond_branch', 'hr_attendance', 'portal', 'auth_passkey_portal'], 'data': [ 'security/beyond_attendance_security.xml', 'security/ir.model.access.csv', diff --git a/addons/beyond_attendance_qr/views/portal_templates.xml b/addons/beyond_attendance_qr/views/portal_templates.xml index dbfef70..b38cb92 100644 --- a/addons/beyond_attendance_qr/views/portal_templates.xml +++ b/addons/beyond_attendance_qr/views/portal_templates.xml @@ -383,4 +383,14 @@ + + + diff --git a/addons/beyond_base/__manifest__.py b/addons/beyond_base/__manifest__.py index a2eb5c3..dfe7b6c 100644 --- a/addons/beyond_base/__manifest__.py +++ b/addons/beyond_base/__manifest__.py @@ -23,7 +23,7 @@ enlace de "¿Olvidaste tu contraseña?" es el suyo, con su condición real. 'category': 'Beyond', 'author': 'Collina Systems', 'license': 'Other proprietary', - 'depends': ['base', 'web', 'auth_signup', 'hr', 'hr_attendance'], + 'depends': ['base', 'web', 'auth_signup', 'auth_passkey', 'hr', 'hr_attendance'], 'data': [ 'security/beyond_security.xml', 'data/branding.xml', @@ -35,6 +35,7 @@ enlace de "¿Olvidaste tu contraseña?" es el suyo, con su condición real. 'data/url_publica.xml', 'data/signup.xml', 'views/login_templates.xml', + 'views/passkey_templates.xml', 'views/webclient_templates.xml', ], 'demo': [ diff --git a/addons/beyond_base/models/__init__.py b/addons/beyond_base/models/__init__.py index 5c8dcef..211876a 100644 --- a/addons/beyond_base/models/__init__.py +++ b/addons/beyond_base/models/__init__.py @@ -5,5 +5,6 @@ from . import ir_cron from . import res_company from . import res_lang from . import res_users +from . import res_users_identitycheck from . import beyond_acentos from . import ir_ui_view diff --git a/addons/beyond_base/models/res_users_identitycheck.py b/addons/beyond_base/models/res_users_identitycheck.py new file mode 100644 index 0000000..4cfabbc --- /dev/null +++ b/addons/beyond_base/models/res_users_identitycheck.py @@ -0,0 +1,19 @@ +# Part of Beyond. Collina Systems proprietary module. +from odoo import api, models + + +class ResUsersIdentitycheck(models.TransientModel): + """Confirmar la identidad nunca arranca en la llave de acceso (14-sep-2026). + + auth_passkey pone 'webauthn' por defecto a quien tiene una llave + registrada, y en ese modo el campo de contraseña se oculta: la única + salida, «Usar contraseña», vivía en el bloque que retira + views/passkey_templates.xml. Sin esto, quien registró una llave abriría + el asistente a una hoja en blanco. + """ + _inherit = 'res.users.identitycheck' + + @api.model + def _get_default_auth_method(self): + metodo = super()._get_default_auth_method() + return 'password' if metodo == 'webauthn' else metodo diff --git a/addons/beyond_base/static/src/login/beyond_login.scss b/addons/beyond_base/static/src/login/beyond_login.scss index d785afd..e0bf168 100644 --- a/addons/beyond_base/static/src/login/beyond_login.scss +++ b/addons/beyond_base/static/src/login/beyond_login.scss @@ -289,13 +289,13 @@ $beyond-login-error: #C55A22; // --------------------------------------------------------------------- // Call to action // --------------------------------------------------------------------- - // ENGINEERING — core wraps the CTA and everything auth_signup/auth_passkey - // bolt onto it in one `oe_login_buttons` div. That div has to survive (it - // is their xpath anchor) but it must not be a box, or its contents cannot - // be interleaved with the server's messages. `display: contents` dissolves - // it: the CTA and the passkey block become items of the form's own column, - // on its 26px rhythm, and `order` below can place the message between them - // — under the CTA, where the design puts it. + // ENGINEERING — core wraps the CTA and everything auth_signup bolts onto + // it in one `oe_login_buttons` div. That div has to survive (it is the + // xpath anchor) but it must not be a box, or its contents cannot be + // interleaved with the server's messages. `display: contents` dissolves + // it: the CTA becomes an item of the form's own column, on its 26px + // rhythm, and `order` below can place the message under it, where the + // design puts it. .beyond_login_actions { display: contents; } @@ -331,8 +331,7 @@ $beyond-login-error: #C55A22; // excluded: they light up through the design's own focus state above. .beyond_login_submit, .beyond_login_eye, - .beyond_login_forgot, - .o_login_auth .list-group-item { + .beyond_login_forgot { &:focus-visible { outline: 3px solid $beyond-login-ink; outline-offset: 3px; @@ -361,12 +360,6 @@ $beyond-login-error: #C55A22; font-weight: 700; } - // ...and the passkey block after it, so the message stays glued to the CTA - // that produced it instead of being pushed below an alternative way in. - .o_login_auth { - order: 2; - } - .beyond_login_error, .o_caps_lock_warning_text { color: $beyond-login-error; @@ -381,67 +374,6 @@ $beyond-login-error: #C55A22; display: block; } - // --------------------------------------------------------------------- - // Passkeys - // - // Not in the design, and kept anyway: auth_passkey is installed and this - // block is a real way into the system. Dropping it would lock out anyone - // who registered a key. Dressed in the field's own clothes instead. - // --------------------------------------------------------------------- - .o_login_auth { - display: flex; - flex-direction: column; - gap: 14px; - - > em { - margin: 0; - font-style: normal; - text-align: center; - font-size: 12px; - font-weight: 600; - letter-spacing: 0.04em; - color: $beyond-ink-muted; - } - - .list-group { - display: flex; - flex-direction: column; - gap: 10px; - } - - .list-group-item { - all: unset; - cursor: pointer; - box-sizing: border-box; - width: 100%; - // ENGINEERING — core builds this link from a dict and hangs - // Bootstrap utilities on it (`py-2`, `d-flex`, `gap-2`), which are - // !important. min-height carries the 48px touch floor without - // joining an !important war; the horizontal padding is ours - // because no utility sets it. - min-height: 56px; - padding-left: 18px; - padding-right: 18px; - display: flex; - align-items: center; - justify-content: center; - gap: 10px; - border-radius: 16px; - background: $beyond-login-field-bg; - border: 1.5px solid $beyond-line; - font-size: 15px; - font-weight: 700; - color: $beyond-ink; - text-align: center; - transition: background 140ms ease, border-color 140ms ease; - - &:hover { - background: $beyond-surface-hover; - border-color: $beyond-ink-softer; - } - } - } - // --------------------------------------------------------------------- // The signature, at the foot // --------------------------------------------------------------------- diff --git a/addons/beyond_base/views/login_templates.xml b/addons/beyond_base/views/login_templates.xml index ed29b80..d456ccd 100644 --- a/addons/beyond_base/views/login_templates.xml +++ b/addons/beyond_base/views/login_templates.xml @@ -45,9 +45,15 @@ themselves up. NOTE this only takes the link off this screen — the /web/signup route stays open until `auth_signup.invitation_scope` is set to b2b in Ajustes. - - The passkey block (auth_passkey) STAYS. It is not in the design, but - it is a real way in, and removing it would lock out anyone who - registered a key. It is restyled, not dropped. + - The passkey block (auth_passkey) is REMOVED (14-sep-2026), reversing + the earlier decision to keep it restyled, and so is every other + passkey door in the system (views/passkey_templates.xml, which lists + them). Only the doors are hidden: keys already registered are NOT + deleted and auth_passkey stays installed, so bringing them back is + putting the xpaths back. Here it is taken out at its + `t-call="web.login_oauth"`, which renders the "- o -" separator and + every button in `auth_btns` — today only the passkey, since + auth_oauth is not installed. --> + + oe_login_buttons beyond_login_actions @@ -189,7 +195,11 @@ beyond_login_submit - + + + + diff --git a/addons/beyond_base/views/passkey_templates.xml b/addons/beyond_base/views/passkey_templates.xml new file mode 100644 index 0000000..5cd871f --- /dev/null +++ b/addons/beyond_base/views/passkey_templates.xml @@ -0,0 +1,67 @@ + + + + + + + + + + res.users.form.beyond.no.passkey + res.users + + 99 + + + + + + + res.users.preferences.beyond.no.passkey + res.users + + 99 + + + + + + + + res.users.identitycheck.form.beyond.no.passkey + res.users.identitycheck + + 99 + + + + + +