feat: support sending "new title" alerts to devices
This commit is contained in:
@@ -56,7 +56,7 @@ export type FcmMessagePayload = {
|
||||
interface Notification {
|
||||
title: string;
|
||||
body: string;
|
||||
image: string;
|
||||
image?: string;
|
||||
}
|
||||
|
||||
interface AndroidConfig {
|
||||
|
||||
24
src/libs/qstash/verifyQstashHeader.ts
Normal file
24
src/libs/qstash/verifyQstashHeader.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
import { Receiver } from "@upstash/qstash";
|
||||
|
||||
import type { Env } from "~/types/env";
|
||||
|
||||
export function verifyQstashHeader(
|
||||
env: Env,
|
||||
signature: string | undefined,
|
||||
body: string,
|
||||
): Promise<boolean> {
|
||||
if (!signature) {
|
||||
return Promise.resolve(false);
|
||||
}
|
||||
|
||||
const receiver = new Receiver({
|
||||
currentSigningKey: env.QSTASH_CURRENT_SIGNING_KEY,
|
||||
nextSigningKey: env.QSTASH_NEXT_SIGNING_KEY,
|
||||
});
|
||||
|
||||
return receiver.verify({
|
||||
body,
|
||||
signature,
|
||||
url: "https://aniplay-v2.rururu.workers.dev",
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user