Rename all middleware to thingMiddleware

This commit is contained in:
Alex Gleason
2024-05-14 12:07:54 -05:00
parent 1accae2222
commit 084143c5c8
5 changed files with 18 additions and 18 deletions

View File

@@ -0,0 +1,16 @@
import { AppMiddleware } from '@/app.ts';
import { UserStore } from '@/storages/UserStore.ts';
import { Storages } from '@/storages.ts';
/** Store middleware. */
export const storeMiddleware: AppMiddleware = async (c, next) => {
const pubkey = await c.get('signer')?.getPublicKey();
if (pubkey) {
const store = new UserStore(pubkey, Storages.admin);
c.set('store', store);
} else {
c.set('store', Storages.admin);
}
await next();
};