Skip to content
This repository was archived by the owner on Nov 27, 2023. It is now read-only.

Commit 2e1b1b9

Browse files
author
haydenyoung
committed
Access global identity.
1 parent 0931fea commit 2e1b1b9

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

src/lib/db-manager.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,10 @@ class DBManager {
8484
)
8585
};
8686
};
87+
88+
this.identity = () => {
89+
return orbitdb.identity;
90+
};
8791
}
8892
}
8993

src/lib/orbitdb-api.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -201,11 +201,10 @@ class OrbitdbAPI extends Express {
201201
return contents
202202
}
203203

204-
this.get('/db/:dbname/identity', asyncMiddleware( async (req, res, next) => {
205-
const db = await dbm.get(req.params.dbname);
206-
const identity = db.identity;
204+
this.get('/identity', asyncMiddleware( async (req, res, next) => {
205+
const identity = dbm.identity()
207206

208-
return res.json(identity);
207+
return res.json(identity)
209208
}));
210209

211210
var db_put_write_public_key = asyncMiddleware( async (req, res, next) => {

0 commit comments

Comments
 (0)