fix(core): update

This commit is contained in:
Philipp Kunz 2018-11-11 19:06:53 +01:00
parent a988e5513c
commit d5f4a19cc3

View File

@ -27,15 +27,17 @@ export class SmartlogReceiver {
/**
* handles a authenticated log
*/
handleAuthenticatedLog(authenticatedLogPackageArg: ILogPackageAuthenticated) {
async handleAuthenticatedLog(authenticatedLogPackageArg: ILogPackageAuthenticated) {
const authString = authenticatedLogPackageArg.auth;
const logPackage = authenticatedLogPackageArg.logPackage;
if(authString === plugins.smarthash.sha256FromStringSync(this.passphrase)) {
// this.smartlogInstance.log('ok', 'Message accepted');
this.smartlogInstance.handleLogPackage(logPackage);
return { status: 'ok' };
} else {
this.smartlogInstance.log('error', 'Message rejected because of bad passphrase');
return { status: 'error' };
// console.log(plugins.smarthash.sha256FromStringSync(this.passphrase));
}
}