Merge pull request #124 from shocknet/gun-status-http-2

gun auth status http endpoint
This commit is contained in:
Daniel Lugo 2020-07-28 11:45:06 -04:00 committed by GitHub
commit fc043a6ba6
2 changed files with 12 additions and 2 deletions

View file

@ -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.
*/

View file

@ -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']
}