details:   https://code.tryton.org/tryton/commit/e27559e7c8ab
branch:    default
user:      Cédric Krier <[email protected]>
date:      Thu Aug 27 09:19:47 2026 +0200
description:
        Disable the login services on the localhost URL

        Closes #15045
diffstat:

 sao/src/session.js |  9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diffs (28 lines):

diff -r 56a9566c4b88 -r e27559e7c8ab sao/src/session.js
--- a/sao/src/session.js        Mon Aug 31 12:26:39 2026 +0200
+++ b/sao/src/session.js        Thu Aug 27 09:19:47 2026 +0200
@@ -378,6 +378,9 @@
 
         jQuery.when(Sao.Authentication.services()).then(function(services) {
             if (services.length) {
+                let localhost = (
+                    (window.location.protocol == 'http:')
+                    && window.location.host.startsWith('localhost:'));
                 var panel_body = jQuery('<div/>', {
                     'class': 'panel-body',
                 }).append(jQuery('<p/>')
@@ -389,8 +392,14 @@
                     panel_body.append(jQuery('<button/>', {
                         'class': 'btn btn-block btn-default',
                         'type': 'button',
+                        'disabled': localhost,
                     }).text(name).click(url, login_service));
                 }
+                if (localhost) {
+                    panel_body.append(jQuery('<p/>', {
+                        'class': 'text-warning',
+                    }).text(Sao.i18n.gettext("Disabled on localhost")));
+                }
             }
         });
         return dfd.promise();

Reply via email to