mirror of
https://github.com/misskey-dev/misskey.git
synced 2024-12-24 00:39:32 +09:00
set result to keypairEntityCache
This commit is contained in:
parent
41883c451d
commit
5afc659afa
@ -136,7 +136,8 @@ export class UserKeypairService implements OnApplicationShutdown {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* If DB has ed25519 keypair, refresh cache and return it.
|
||||||
|
* If not, create, save and return ed25519 keypair.
|
||||||
* @param userId user id
|
* @param userId user id
|
||||||
* @returns MiUserKeypair if keypair is created, void if keypair is already exists
|
* @returns MiUserKeypair if keypair is created, void if keypair is already exists
|
||||||
*/
|
*/
|
||||||
@ -154,11 +155,13 @@ export class UserKeypairService implements OnApplicationShutdown {
|
|||||||
ed25519PrivateKey: ed25519.privateKey,
|
ed25519PrivateKey: ed25519.privateKey,
|
||||||
});
|
});
|
||||||
this.globalEventService.publishInternalEvent('userKeypairUpdated', { userId });
|
this.globalEventService.publishInternalEvent('userKeypairUpdated', { userId });
|
||||||
return {
|
const result = {
|
||||||
...keypair,
|
...keypair,
|
||||||
ed25519PublicKey: ed25519.publicKey,
|
ed25519PublicKey: ed25519.publicKey,
|
||||||
ed25519PrivateKey: ed25519.privateKey,
|
ed25519PrivateKey: ed25519.privateKey,
|
||||||
};
|
};
|
||||||
|
this.keypairEntityCache.set(userId, result);
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@bindThis
|
@bindThis
|
||||||
|
Loading…
Reference in New Issue
Block a user