fix(core): update
This commit is contained in:
parent
a988e5513c
commit
d5f4a19cc3
@ -27,15 +27,17 @@ export class SmartlogReceiver {
|
|||||||
/**
|
/**
|
||||||
* handles a authenticated log
|
* handles a authenticated log
|
||||||
*/
|
*/
|
||||||
handleAuthenticatedLog(authenticatedLogPackageArg: ILogPackageAuthenticated) {
|
async handleAuthenticatedLog(authenticatedLogPackageArg: ILogPackageAuthenticated) {
|
||||||
const authString = authenticatedLogPackageArg.auth;
|
const authString = authenticatedLogPackageArg.auth;
|
||||||
const logPackage = authenticatedLogPackageArg.logPackage;
|
const logPackage = authenticatedLogPackageArg.logPackage;
|
||||||
|
|
||||||
if(authString === plugins.smarthash.sha256FromStringSync(this.passphrase)) {
|
if(authString === plugins.smarthash.sha256FromStringSync(this.passphrase)) {
|
||||||
// this.smartlogInstance.log('ok', 'Message accepted');
|
// this.smartlogInstance.log('ok', 'Message accepted');
|
||||||
this.smartlogInstance.handleLogPackage(logPackage);
|
this.smartlogInstance.handleLogPackage(logPackage);
|
||||||
|
return { status: 'ok' };
|
||||||
} else {
|
} else {
|
||||||
this.smartlogInstance.log('error', 'Message rejected because of bad passphrase');
|
this.smartlogInstance.log('error', 'Message rejected because of bad passphrase');
|
||||||
|
return { status: 'error' };
|
||||||
// console.log(plugins.smarthash.sha256FromStringSync(this.passphrase));
|
// console.log(plugins.smarthash.sha256FromStringSync(this.passphrase));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user