mirror of
https://github.com/status-im/embark-area-51.git
synced 2025-01-11 06:25:57 +00:00
rename event
This commit is contained in:
parent
8a4e1063a7
commit
ae3185d96f
@ -45,7 +45,7 @@ class Authenticator {
|
|||||||
(`http://${host}:${port}/embark?token=${this.authToken}`.underline)));
|
(`http://${host}:${port}/embark?token=${this.authToken}`.underline)));
|
||||||
});
|
});
|
||||||
|
|
||||||
this.events.setCommandHandler('api:authorize', (token, cb) => {
|
this.events.setCommandHandler('authenticator:authorize', (token, cb) => {
|
||||||
if (token !== this.authToken) {
|
if (token !== this.authToken) {
|
||||||
return cb(ERROR_OBJ);
|
return cb(ERROR_OBJ);
|
||||||
}
|
}
|
||||||
|
@ -167,7 +167,7 @@ class Server {
|
|||||||
}
|
}
|
||||||
|
|
||||||
applyAPIFunction (cb, req, res) {
|
applyAPIFunction (cb, req, res) {
|
||||||
this.events.request('api:authorize', req.headers.authorization, (err) => {
|
this.events.request('authenticator:authorize', req.headers.authorization, (err) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
const send = res.send ? res.send.bind(res) : req.send.bind(req); // WS only has the first params
|
const send = res.send ? res.send.bind(res) : req.send.bind(req); // WS only has the first params
|
||||||
return send(err);
|
return send(err);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user