XOAUTH2 is made opt-in by proxmox-widget-toolkit. Opt into it in PVE,
introducing XOAUTH2 support for SMTP notification targets, and pass the
backend URL for getting a refresh token in PVE to the SMTP edit panel.

Signed-off-by: Arthur Bied-Charreton <[email protected]>
---
 www/manager6/Utils.js | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/www/manager6/Utils.js b/www/manager6/Utils.js
index bbf59d8f..89f322e6 100644
--- a/www/manager6/Utils.js
+++ b/www/manager6/Utils.js
@@ -2255,5 +2255,16 @@ Ext.define('PVE.Utils', {
             replication: gettext('Replication job notifications'),
             fencing: gettext('Node fencing notifications'),
         });
+
+        Proxmox.Schema.overrideEndpointTypes({
+            smtp: {
+                name: 'SMTP',
+                ipanel: 'pmxSmtpEditPanel',
+                iconCls: 'fa-envelope-o',
+                defaultMailAuthor: 'Proxmox VE',
+                enableOAuth2: true,
+                refreshTokenUrl: '/cluster/notifications/smtp-oauth2-token',
+            },
+        });
     },
 });
-- 
2.47.3



Reply via email to