Skip to content

Commit

Permalink
chore: patch functions for PR review
Browse files Browse the repository at this point in the history
  • Loading branch information
czabaj committed Dec 18, 2024
1 parent 835e6d7 commit b444028
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions functions/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,11 @@ import {
getPrivateCollection,
} from "./helpers";

const CORS = [`https://check.beer`, /localhost:\d+$/];
const CORS = [
`https://check.beer`,
/localhost:\d+$/,
/^https:\/\/beerbook2-da255--pr2-vg-web-push-\w+\.web\.app$/,
];
const REGION = `europe-west3`;

initializeApp();
Expand Down Expand Up @@ -163,7 +167,7 @@ export const truncateUserInDb = auth.user().onDelete(async (user) => {
* This function has access to a private collection and stores there the notification registration token of the user.
*/
export const updateNotificationToken = onCall<UpdateDeviceTokenMessage>(
{ cors: CORS, region: REGION },
{ cors: CORS, enforceAppCheck: true, region: REGION },
async (request) => {
const uid = request.auth?.uid;
if (!uid) {
Expand Down Expand Up @@ -249,7 +253,7 @@ const getUserFamiliarName = async (
*
*/
export const dispatchNotification = onCall<NotificationEventMessages>(
{ cors: CORS, region: REGION },
{ cors: CORS, enforceAppCheck: true, region: REGION },
async (request) => {
const uid = request.auth?.uid;
if (!uid) {
Expand Down

0 comments on commit b444028

Please sign in to comment.