mirror of
https://github.com/maziggy/bambuddy.git
synced 2026-10-07 23:01:06 +02:00
Reporter wintsa123 (China-region user, bambulab.cn) couldn't log into Bambuddy. Looked like a code bug; turned out the code is fine and only the docs were wrong. What's already there (no change needed): - PR #1013 (April) added the China region selector to the token-login flow and routes validation to api.bambulab.cn instead of api.bambulab.com. The selector is in the form (frontend/src/pages/ProfilesPage.tsx:204-205) and the backend dispatch is in backend/app/services/bambu_cloud.py:15 + backend/app/api/routes/cloud.py:174. What was wrong: - The in-app `accessTokenHint` said "Paste your Bambu Lab access token (from Bambu Studio)" in all 8 locales. Bambu Studio never exposed the token in any UI, and the profile page on bambulab.com that used to show it has been removed. The hint was pointing users at sources that don't exist. - For China-region accounts the email / password flow is fundamentally unusable because those accounts are bound to phone numbers, not email — token login is the only working path. The hint didn't say so, so reporters kept trying email login first and getting confused. - The wiki's "Access Token Login" section in features/cloud-profiles.md only described the dead profile-page method and a Python-script alternative that only works against the global API. No mention of the China-region selector and no mention of the MakerWorld-cookie method that actually works today. What this change does: - Rewrites `accessTokenHint` in all 8 locales (en, de, fr, it, ja, pt-BR, zh-CN, zh-TW) to state that China-region accounts must use the token path and point at the wiki for the cookie retrieval procedure. zh-CN and zh-TW translations were written for the audience that actually needs this. - Rewrites the wiki's Access Token Login section: adds a "Region: China must use token login" callout, replaces the dead profile-page guidance with the MakerWorld cookie method (both makerworld.com and makerworld.com.cn, with the browser DevTools steps), keeps the Python-script alternative explicitly scoped to global-region accounts, and warns that the cookie value is sensitive and shouldn't be pasted into screenshots or threads. No backend changes. Once a user has the token + Region: China selected, the existing flow works.
React + TypeScript + Vite
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
Currently, two official plugins are available:
- @vitejs/plugin-react uses Babel (or oxc when used in rolldown-vite) for Fast Refresh
- @vitejs/plugin-react-swc uses SWC for Fast Refresh
React Compiler
The React Compiler is not enabled on this template because of its impact on dev & build performances. To add it, see this documentation.
Expanding the ESLint configuration
If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules:
export default defineConfig([
globalIgnores(['dist']),
{
files: ['**/*.{ts,tsx}'],
extends: [
// Other configs...
// Remove tseslint.configs.recommended and replace with this
tseslint.configs.recommendedTypeChecked,
// Alternatively, use this for stricter rules
tseslint.configs.strictTypeChecked,
// Optionally, add this for stylistic rules
tseslint.configs.stylisticTypeChecked,
// Other configs...
],
languageOptions: {
parserOptions: {
project: ['./tsconfig.node.json', './tsconfig.app.json'],
tsconfigRootDir: import.meta.dirname,
},
// other options...
},
},
])
You can also install eslint-plugin-react-x and eslint-plugin-react-dom for React-specific lint rules:
// eslint.config.js
import reactX from 'eslint-plugin-react-x'
import reactDom from 'eslint-plugin-react-dom'
export default defineConfig([
globalIgnores(['dist']),
{
files: ['**/*.{ts,tsx}'],
extends: [
// Other configs...
// Enable lint rules for React
reactX.configs['recommended-typescript'],
// Enable lint rules for React DOM
reactDom.configs.recommended,
],
languageOptions: {
parserOptions: {
project: ['./tsconfig.node.json', './tsconfig.app.json'],
tsconfigRootDir: import.meta.dirname,
},
// other options...
},
},
])