Allow posting a status to Nostr

This commit is contained in:
Alex Gleason
2023-03-04 23:26:25 -06:00
parent 73884c212f
commit 2acfecc1eb
9 changed files with 122 additions and 8 deletions

17
src/utils.ts Normal file
View File

@@ -0,0 +1,17 @@
import { Context, getPublicKey } from '@/deps.ts';
function getKeys(c: Context) {
const auth = c.req.headers.get('Authorization') || '';
if (auth.startsWith('Bearer ')) {
const privatekey = auth.split('Bearer ')[1];
const pubkey = getPublicKey(privatekey);
return {
privatekey,
pubkey,
};
}
}
export { getKeys };