diff --git a/src/routes.js b/src/routes.js index 4bee66cc..ff88958c 100644 --- a/src/routes.js +++ b/src/routes.js @@ -2382,6 +2382,14 @@ module.exports = async ( }) } }) + + ap.get(`/api/gun/auth`, (_, res) => { + const { isAuthenticated } = require('../services/gunDB/Mediator') + + return res.status(200).json({ + data: isAuthenticated() + }) + }) /** * Return app so that it can be used by express. */ diff --git a/utils/protectedRoutes.js b/utils/protectedRoutes.js index 8ece4f12..e3d53d44 100644 --- a/utils/protectedRoutes.js +++ b/utils/protectedRoutes.js @@ -7,7 +7,9 @@ module.exports = { "/favicon.ico": true, "/api/lnd/connect": true, "/api/lnd/wallet/status": true, - "/api/lnd/auth": true + "/api/lnd/auth": true, + // + "/api/gun/auth": true }, POST: { "/api/lnd/connect": true, @@ -28,5 +30,5 @@ module.exports = { PUT: {}, DELETE: {} }, - nonEncryptedRoutes: ['/api/security/exchangeKeys', '/healthz', '/ping', '/api/lnd/wallet/status'] + nonEncryptedRoutes: ['/api/security/exchangeKeys', '/healthz', '/ping', '/api/lnd/wallet/status', '/api/gun/auth'] } \ No newline at end of file