From 3deec2624f556ab45259d72efc5666550a263fa6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20R=C3=ADos?= Date: Wed, 1 May 2024 20:54:40 +0200 Subject: [PATCH] hotfix: update `auth` (#17) * fix: use `happy-headers` auth * fix: update `fresh` * fix: remove headers from `readme` * fix: changelog `width` * fix: remove `search` icon * fix: update`google` api keys * fix: remove `red` background --- README.md | 15 --------------- client.ts | 12 ++---------- deno.json | 5 +++-- islands/Changelog.tsx | 6 +++--- islands/Navbar.tsx | 6 ------ routes/api/send.ts | 4 ++-- routes/api/verify.ts | 6 +++--- 7 files changed, 13 insertions(+), 41 deletions(-) diff --git a/README.md b/README.md index 0dcd2fa..797bf83 100644 --- a/README.md +++ b/README.md @@ -61,23 +61,8 @@ GITHUB_TOKEN= # Google Analytics tracking ID (Optional) GA4_MEASUREMENT_ID= - -# BeReal Signature -BEREAL_SIGNATURE= - -# BeReal Device ID -BEREAL_DEVICE_ID= - -# BeReal Timezone -BEREAL_TIMEZONE= ``` -> [!WARNING]\ -> The `BEREAL_SIGNATURE` and `BEREAL_DEVICE_ID` are required for the app to -> function. You can find them by inspecting the network requests made by the -> BeReal app in a rooted Android device using -> [Burp Suite](https://portswigger.net/burp) and [Frida](https://frida.re/). - Run the development server: ```sh diff --git a/client.ts b/client.ts index e78dc55..6b2c4f8 100644 --- a/client.ts +++ b/client.ts @@ -1,18 +1,10 @@ import { z } from "zod"; +import getHeaders from "happy-headers"; import { type ApiFunction, type APIMap, type ApiValidators } from "~/types.ts"; export const headers = (_templates: TemplateStringsArray, token: string) => ({ - "Bereal-Platform": "android", - "Bereal-App-Language": "en-US", - "Bereal-Device-Language": "en-US", - "Bereal-App-Version": "1.19.6", - "Bereal-Os-Version": "10", - "Bereal-Device-Id": Deno.env.get("BEREAL_DEVICE_ID")!, - "Bereal-Timezone": Deno.env.get("BEREAL_TIMEZONE")!, - "Bereal-App-Version-Code": "1631", - "Bereal-Signature": Deno.env.get("BEREAL_SIGNATURE")!, - "User-Agent": "okhttp/4.12.0", "Authorization": `Bearer ${token}`, + ...getHeaders(), }); const refresh = () => ({ diff --git a/deno.json b/deno.json index d88e422..3e20ee8 100644 --- a/deno.json +++ b/deno.json @@ -8,7 +8,7 @@ }, "lint": { "rules": { "tags": ["fresh", "recommended"] } }, "imports": { - "$fresh/": "https://deno.land/x/fresh@1.6.5/", + "$fresh/": "https://deno.land/x/fresh@1.6.8/", "preact": "https://esm.sh/preact@10.19.2", "preact/": "https://esm.sh/preact@10.19.2/", "preact-render-to-string": "https://esm.sh/*preact-render-to-string@6.2.1", @@ -28,7 +28,8 @@ "~/": "./", "@twind/core": "https://esm.sh/@twind/core@1.1.3", "@twind/preset-tailwind": "https://esm.sh/@twind/preset-tailwind@1.1.4/", - "@twind/preset-autoprefix": "https://esm.sh/@twind/preset-autoprefix@1.0.7/" + "@twind/preset-autoprefix": "https://esm.sh/@twind/preset-autoprefix@1.0.7/", + "happy-headers": "npm:happy-headers" }, "compilerOptions": { "jsx": "react-jsx", "jsxImportSource": "preact" }, "exclude": ["**/_fresh/*"], diff --git a/islands/Changelog.tsx b/islands/Changelog.tsx index 39a3830..f53a144 100644 --- a/islands/Changelog.tsx +++ b/islands/Changelog.tsx @@ -19,8 +19,8 @@ export default function Changelog() { }, []); return ( - <> -
+
+

Changelog

@@ -64,6 +64,6 @@ export default function Changelog() {
)} - +
); } diff --git a/islands/Navbar.tsx b/islands/Navbar.tsx index eeeaa54..2c111cf 100644 --- a/islands/Navbar.tsx +++ b/islands/Navbar.tsx @@ -7,7 +7,6 @@ import IconReload from "icons/reload.tsx"; import IconArrowBigLeft from "icons/arrow-big-left.tsx"; import IconUser from "icons/user.tsx"; import IconChartBar from "icons/chart-bar.tsx"; -import IconSearch from "icons/search.tsx"; import { isLoggedIn, logout, store } from "~/state/auth.ts"; export default function Navbar() { @@ -53,11 +52,6 @@ export default function Navbar() { )} - {isLogged && ( - - - - )} {isDarkMode ? : } diff --git a/routes/api/send.ts b/routes/api/send.ts index 9315a57..0314203 100644 --- a/routes/api/send.ts +++ b/routes/api/send.ts @@ -63,7 +63,7 @@ export const handler = async ( } const receiptResponse = await fetch( - "https://www.googleapis.com/identitytoolkit/v3/relyingparty/verifyClient?key=AIzaSyDwjfEeparokD7sXPVQli9NsTuhT6fJ6iA", + "https://www.googleapis.com/identitytoolkit/v3/relyingparty/verifyClient?key=AIzaSyCgNTZt6gzPMh-2voYXOvrt_UR_gpGl83Q", { method: "POST", headers: { @@ -103,7 +103,7 @@ export const handler = async ( }; const otpResponse = await fetch( - "https://www.googleapis.com/identitytoolkit/v3/relyingparty/sendVerificationCode?key=AIzaSyDwjfEeparokD7sXPVQli9NsTuhT6fJ6iA", + "https://www.googleapis.com/identitytoolkit/v3/relyingparty/sendVerificationCode?key=AIzaSyCgNTZt6gzPMh-2voYXOvrt_UR_gpGl83Q", { method: "POST", headers: { diff --git a/routes/api/verify.ts b/routes/api/verify.ts index dd75001..be6e37e 100644 --- a/routes/api/verify.ts +++ b/routes/api/verify.ts @@ -63,7 +63,7 @@ export const handler = async ( }; const googleResponse = await fetch( - "https://www.googleapis.com/identitytoolkit/v3/relyingparty/verifyCustomToken?key=AIzaSyDwjfEeparokD7sXPVQli9NsTuhT6fJ6iA", + "https://www.googleapis.com/identitytoolkit/v3/relyingparty/verifyCustomToken?key=AIzaSyCgNTZt6gzPMh-2voYXOvrt_UR_gpGl83Q", { method: "POST", body: JSON.stringify({ @@ -113,7 +113,7 @@ export const handler = async ( } const fireResponse = await fetch( - "https://www.googleapis.com/identitytoolkit/v3/relyingparty/verifyPhoneNumber?key=AIzaSyDwjfEeparokD7sXPVQli9NsTuhT6fJ6iA", + "https://www.googleapis.com/identitytoolkit/v3/relyingparty/verifyPhoneNumber?key=AIzaSyCgNTZt6gzPMh-2voYXOvrt_UR_gpGl83Q", { method: "POST", headers: { @@ -165,7 +165,7 @@ export const handler = async ( } const tokenResponse = await fetch( - "https://securetoken.googleapis.com/v1/token?key=AIzaSyDwjfEeparokD7sXPVQli9NsTuhT6fJ6iA", + "https://securetoken.googleapis.com/v1/token?key=AIzaSyCgNTZt6gzPMh-2voYXOvrt_UR_gpGl83Q", { method: "POST", headers: {