Enhance admin interface, security, and feed management with improved UX and authentication
This commit is contained in:
1 parent
8839aac24b
commit
56a8263f33
19 files changed
+2021
-522
No files matched your search
+10
-1
@@ -40,7 +40,7 @@ export async function handle(c: Context): Promise<Response> {
|
||||
contentType: payload.html ? 'HTML' : 'Text'
|
||||
});
|
||||
|
||||
// Extract feed ID from email address (e.g., [email protected] -> xyz)
|
||||
// Extract feed ID from email address (e.g., [email protected] -> apple.mountain.42)
|
||||
const toAddress = payload.recipients?.[0] || '';
|
||||
const feedId = EmailParser.extractFeedId(toAddress);
|
||||
|
||||
@@ -49,6 +49,15 @@ export async function handle(c: Context): Promise<Response> {
|
||||
return new Response('Invalid email address format', { status: 400 });
|
||||
}
|
||||
|
||||
// Check if the feed exists by looking up the feed configuration
|
||||
const feedConfigKey = `feed:${feedId}:config`;
|
||||
const feedConfig = await env.EMAIL_STORAGE.get(feedConfigKey, 'json');
|
||||
|
||||
if (!feedConfig) {
|
||||
console.error(`Feed with ID ${feedId} does not exist or has been deleted`);
|
||||
return new Response('Feed does not exist', { status: 404 });
|
||||
}
|
||||
|
||||
// Parse the email using our simplified parser
|
||||
const emailData = EmailParser.parseForwardEmailPayload(payload);
|
||||
|
||||
|
||||
Reference in new issue
Block a user