From add80af26d95b406806f611fb3dc2138eb5a151a Mon Sep 17 00:00:00 2001 From: prathmesh-sananse Date: Wed, 27 Aug 2025 09:58:44 +0530 Subject: [PATCH 1/2] Issue #541: Support on auth.error event --- index.md | 5 +++++ src/hello.js | 10 ++++++++++ 2 files changed, 15 insertions(+) diff --git a/index.md b/index.md index e38cc295..1a7ed856 100644 --- a/index.md +++ b/index.md @@ -34,6 +34,11 @@ hello.init(CLIENT_IDS_ALL, { oauth_proxy: OAUTH_PROXY_URL }); +// Issue 541 : Support on auth.error event - @prathmesh-sananse +hello.on('auth.error', function(e) { + console.error("Auth error from " + e.network, e.error); +}); + getText('assets/test_network.html', function(response) { document.getElementById('tests-template').text = response; // Knockout binding goes here diff --git a/src/hello.js b/src/hello.js index a310208e..b0d0dcb9 100644 --- a/src/hello.js +++ b/src/hello.js @@ -1621,6 +1621,16 @@ hello.utils.Event.call(hello); emit('update'); } + // Issue 541 : Support on auth.error event - @prathmesh-sananse + // Check if there was an error in the session + else if (session && session.error) { + hello.emit('auth.error', { + network: name, + error: session.error, + authResponse: session + }); + } + // Updated stored session oldSessions[name] = session; From 57ab9746e9454781ac50e1e1a5df9bffdae0d52d Mon Sep 17 00:00:00 2001 From: prathmesh-sananse Date: Wed, 27 Aug 2025 10:06:50 +0530 Subject: [PATCH 2/2] Issue #541: Support on auth.error event --- index.md | 5 ----- 1 file changed, 5 deletions(-) diff --git a/index.md b/index.md index 1a7ed856..e38cc295 100644 --- a/index.md +++ b/index.md @@ -34,11 +34,6 @@ hello.init(CLIENT_IDS_ALL, { oauth_proxy: OAUTH_PROXY_URL }); -// Issue 541 : Support on auth.error event - @prathmesh-sananse -hello.on('auth.error', function(e) { - console.error("Auth error from " + e.network, e.error); -}); - getText('assets/test_network.html', function(response) { document.getElementById('tests-template').text = response; // Knockout binding goes here