Skip to content
This repository was archived by the owner on Feb 23, 2021. It is now read-only.

Commit 6a8ecdf

Browse files
bryanvuRoasbeef
authored andcommitted
Revert "auth: add support for macaroons"
This reverts commit 4663b07.
1 parent eb158b7 commit 6a8ecdf

File tree

2 files changed

+3
-13
lines changed

2 files changed

+3
-13
lines changed

apps/desktop/main.dev.js

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ const processes = [
7171
isDev ? '' : '--neutrino.connect=127.0.0.1:18333',
7272
isDev ? '' : '--debuglevel=info',
7373
isDev ? '' : '--autopilot.active',
74+
'--no-macaroons',
7475
],
7576
},
7677
]
@@ -79,21 +80,17 @@ runProcesses(processes, logs)
7980

8081
let intervalId
8182
let certPath
82-
let macaroonPath
8383
const homedir = os.homedir()
8484

8585
switch (os.platform()) {
8686
case 'darwin':
8787
certPath = path.join(homedir, 'Library/Application\ Support/Lnd/tls.cert')
88-
macaroonPath = path.join(homedir, 'Library/Application\ Support/Lnd/admin.macaroon')
8988
break
9089
case 'linux':
9190
certPath = path.join(homedir, '.lnd/tls.cert')
92-
macaroonPath = path.join(homedir, '.lnd/admin.macaroon')
9391
break
9492
case 'win32':
9593
certPath = path.join(homedir, 'AppData', 'Local', 'Lnd', 'tls.cert')
96-
macaroonPath = path.join(homedir, 'AppData', 'Local', 'Lnd', 'admin.macaroon')
9794
break
9895
default:
9996
break
@@ -192,13 +189,9 @@ const createWindow = () => {
192189
const credentials = grpc.credentials.createSsl(lndCert)
193190
const { lnrpc } = grpc.load(path.join(__dirname, 'rpc.proto'))
194191
const connection = new lnrpc.Lightning('localhost:10009', credentials)
195-
let metadata = new grpc.Metadata()
196-
const macaroonHex = fs.readFileSync(macaroonPath).toString("hex")
197-
metadata.add('macaroon', macaroonHex)
198192
const serverReady = cb =>
199193
grpc.waitForClientReady(connection, Infinity, cb)
200194
global.connection = connection
201-
global.metadata = metadata
202195
global.serverReady = serverReady
203196
finishCreateWindow()
204197
}

packages/redux-grpc-middleware/index.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import { remote } from 'electron'
66
const defaults = {
77
global: {
88
connection: 'connection',
9-
metadata: 'metadata',
109
serverReady: 'serverReady',
1110
},
1211
selector: 'default',
@@ -19,7 +18,6 @@ export const SERVER_RUNNING = 'GRPC/SERVER_RUNNING'
1918
export default (opts = {}) => {
2019
const options = { ...defaults, ...opts }
2120
const serverReady = remote.getGlobal(options.global.serverReady)
22-
const metadata = remote.getGlobal(options.global.metadata)
2321

2422
let client
2523
let ready = false
@@ -69,7 +67,7 @@ export default (opts = {}) => {
6967
if (client[method]) {
7068
let streamCall
7169
try {
72-
streamCall = client[method](body ? { body } : params, metadata)
70+
streamCall = client[method](body ? { body } : params)
7371
} catch (err) {
7472
console.log('Error From Stream Method', method, err)
7573
} finally {
@@ -85,8 +83,7 @@ export default (opts = {}) => {
8583

8684
return new Promise((resolve, reject) => {
8785
try {
88-
client[method] && client[method](body, metadata, { deadline },
89-
(error, res) => {
86+
client[method] && client[method](body, { deadline }, (error, res) => {
9087
if (error) {
9188
ERROR && next({ type: ERROR, error })
9289
reject({ ...error })

0 commit comments

Comments
 (0)