mirror of
https://github.com/juherr/kill-the-news.git
synced 2026-06-20 22:03:48 +00:00
chore: modernize setup, dependencies, and project docs
This commit is contained in:
+3
-2
@@ -1,4 +1,5 @@
|
||||
import { Context, Hono } from 'hono';
|
||||
import { getCookie } from 'hono/cookie';
|
||||
import { html, raw } from 'hono/html';
|
||||
import { z } from 'zod';
|
||||
import { Env, FeedConfig, FeedList, FeedMetadata, EmailMetadata, EmailData, FeedListItem } from '../types';
|
||||
@@ -28,7 +29,7 @@ async function authMiddleware(c: Context, next: () => Promise<void>) {
|
||||
return next();
|
||||
}
|
||||
|
||||
const authCookie = c.req.cookie('admin_auth');
|
||||
const authCookie = getCookie(c, 'admin_auth');
|
||||
if (!authCookie || authCookie !== 'true') {
|
||||
return c.redirect('/admin/login');
|
||||
}
|
||||
@@ -1047,4 +1048,4 @@ app.post('/api/feeds/:feedId/update', async (c) => {
|
||||
});
|
||||
|
||||
// Export the Hono app
|
||||
export const handle = app;
|
||||
export const handle = app;
|
||||
|
||||
Reference in New Issue
Block a user