diff --git a/alby/models.go b/alby/models.go index 2edf00cd..5f76ea40 100644 --- a/alby/models.go +++ b/alby/models.go @@ -48,6 +48,7 @@ type AutoChannelResponse struct { type AlbyMeHub struct { LatestVersion string `json:"latest_version"` + Name string `json:"name"` } type AlbyMe struct { Identifier string `json:"identifier"` diff --git a/frontend/src/screens/settings/DeveloperSettings.tsx b/frontend/src/screens/settings/DeveloperSettings.tsx index 147e6286..bc712a0f 100644 --- a/frontend/src/screens/settings/DeveloperSettings.tsx +++ b/frontend/src/screens/settings/DeveloperSettings.tsx @@ -6,11 +6,13 @@ import { Input } from "src/components/ui/input"; import { Label } from "src/components/ui/label"; import { LoadingButton } from "src/components/ui/loading-button"; import { useToast } from "src/components/ui/use-toast"; +import { useAlbyMe } from "src/hooks/useAlbyMe"; import { copyToClipboard } from "src/lib/clipboard"; import { AuthTokenResponse } from "src/types"; import { request } from "src/utils/request"; export default function DeveloperSettings() { + const { data: albyMe } = useAlbyMe(); const [token, setToken] = React.useState(); const [expiryDays, setExpiryDays] = React.useState("365"); const [unlockPassword, setUnlockPassword] = React.useState(); @@ -129,6 +131,29 @@ export default function DeveloperSettings() { +
+

+ To make requests from your application to{" "} + + {window.location.origin}/api + {" "} + add the following header{albyMe?.hub.name && "s"}: +

+
    +
  1. + + Authorization: Bearer YOUR_TOKEN + {" "} +
  2. + {albyMe?.hub.name && ( +
  3. + + AlbyHub-Name: {albyMe.hub.name} + {" "} +
  4. + )} +
+

This token grants full access to your hub. Please keep it secure. If you suspect that the token has been compromised, diff --git a/frontend/src/types.ts b/frontend/src/types.ts index e3efc88d..4f51fd1f 100644 --- a/frontend/src/types.ts +++ b/frontend/src/types.ts @@ -319,6 +319,7 @@ export type AlbyMe = { shared_node: boolean; hub: { latest_version: string; + name?: string; }; }; diff --git a/frontend/tailwind.config.js b/frontend/tailwind.config.js index f2835e2a..c25deccc 100644 --- a/frontend/tailwind.config.js +++ b/frontend/tailwind.config.js @@ -21,6 +21,7 @@ module.exports = { fontFamily: { // required for Chrome, where e.g. ❤️ in Inter is displayed as a black heart :( emoji: ["sans-serif"], + mono: ["monospace"], }, extend: { colors: {