mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-09 13:01:00 +00:00
A trailing space from the portal's copy button reached WHOOP verbatim and answered as an unknown client; the credential schema trims both fields. The redirect override fell through nullish coalescing, so the empty string the compose whitelist materialises for an unset var was sent as the literal redirect target — empty now derives the callback from the app URL.
17 lines
672 B
TypeScript
17 lines
672 B
TypeScript
import { z } from "zod/v4";
|
|
|
|
/**
|
|
* Per-user WHOOP BYO-key credentials. Each self-hoster registers their own
|
|
* WHOOP dev app and pastes the client id/secret into Settings (the per-app
|
|
* authorized-user cap makes a single shared app unworkable for a
|
|
* multi-operator product). Stored encrypted on `User`.
|
|
*/
|
|
export const whoopCredentialsSchema = z.object({
|
|
// Trimmed: a trailing space or newline from the portal's copy button
|
|
// reaches WHOOP verbatim and answers as "unknown client".
|
|
clientId: z.string().trim().min(1).max(200),
|
|
clientSecret: z.string().trim().min(1).max(200),
|
|
});
|
|
|
|
export type WhoopCredentialsInput = z.infer<typeof whoopCredentialsSchema>;
|