memos/web
Steven 43b5a51ec7 fix(auth): make PKCE optional for OAuth sign-in (#5570)
Fixes issue where OAuth sign-in fails with 'Cannot read properties of
undefined (reading 'digest')' when accessing Memos over HTTP.

The crypto.subtle API is only available in secure contexts (HTTPS or
localhost), but PKCE (RFC 7636) is optional per OAuth 2.0 standards.

Changes:
- Make PKCE generation optional with graceful fallback
- Use PKCE when crypto.subtle available (HTTPS/localhost)
- Fall back to standard OAuth flow when unavailable (HTTP)
- Log warning to console when PKCE unavailable
- Only include code_challenge in auth URL when PKCE enabled

The backend already supports optional PKCE (empty codeVerifier), so no
backend changes needed. This fix aligns frontend behavior with backend.

Benefits:
- OAuth sign-in works on HTTP deployments (reverse proxy scenarios)
- Enhanced security (PKCE) still used when HTTPS available
- Backward compatible with OAuth providers that don't support PKCE

Fixes #5570
2026-02-02 23:28:58 +08:00
..
docs refactor(react-query): optimize config, add error boundary, and remove JSDoc 2025-12-25 08:47:36 +08:00
public chore: enhance site.webmanifest in firefox (#4828) 2025-07-08 19:56:46 +08:00
src fix(auth): make PKCE optional for OAuth sign-in (#5570) 2026-02-02 23:28:58 +08:00
.gitignore chore: update gitignore 2025-04-17 23:11:36 +08:00
biome.json refactor: remove MemoContentContext and integrate MemoViewContext 2025-12-28 12:46:12 +08:00
components.json feat: themes (#4824) 2025-07-07 20:13:22 +08:00
index.html chore: prevent sensitive data caching 2025-12-20 12:33:16 +08:00
package.json fix: KaTeX math rendering with underscores (#5438) 2026-01-06 20:16:01 +08:00
pnpm-lock.yaml fix: KaTeX math rendering with underscores (#5438) 2026-01-06 20:16:01 +08:00
tsconfig.json chore: clean up unused imports and parameters across components 2025-12-27 10:18:38 +08:00
vite.config.mts refactor(web): improve MemoContent security and maintainability 2025-12-02 22:45:22 +08:00