feat: add shared decks and multi-account Mastodon OAuth

This commit is contained in:
2026-09-24 16:52:55 +09:00
parent d2cbf4dbd3
commit c47f58f065
100 changed files with 9215 additions and 1027 deletions
+26
View File
@@ -0,0 +1,26 @@
import {
createCsrfMiddleware,
createMiddleware,
createStart,
} from '@tanstack/react-start'
const ownerAccess = createMiddleware().server(async ({ request, next }) => {
const { checkAccess, readAccessConfig } = await import(
'./features/access/policy.server'
)
return checkAccess(request, readAccessConfig()) ?? next()
})
const csrf = createCsrfMiddleware({
filter: (context) => context.handlerType === 'serverFn',
})
const storage = createMiddleware().server(async ({ next }) => {
const { getDatabase } = await import('./features/storage/database.server')
getDatabase()
return next()
})
export const startInstance = createStart(() => ({
requestMiddleware: [ownerAccess, csrf, storage],
}))