app

Local-first trade for farms and co-ops
git clone https://radroots.dev/git/app.git
Log | Files | Refs | README | LICENSE

inbox-auth.test.ts (581B)


      1 import test from 'node:test';
      2 import assert from 'node:assert/strict';
      3 import {
      4   beginInboxAuthentication,
      5   respondInboxAuthentication
      6 } from '../../src/lib/nostr/inbox-auth.ts';
      7 void test('SSR AUTH admits no private connection, extension or forged action', async () => {
      8   assert.equal(typeof window, 'undefined');
      9   assert.equal(
     10     await beginInboxAuthentication(
     11       {} as never,
     12       'wss://inbox.example.org',
     13       'reviewed_connection_auth'
     14     ),
     15     undefined
     16   );
     17   assert.deepEqual(await respondInboxAuthentication({} as never), {
     18     status: 'invalid'
     19   });
     20 });