-
- Downloads
Check user exists for setup redirect (#19846)
* Add has-user-setup setting - iff no user is setup aka has-user-setup == false, then redirect to /setup - when set from the env variable the setup-token is completely immutable, so can remove clear-token! * make /api/setup only setup accounts when not has-user-setup - react router changes to respect 'has-user-setup' setting - include docstring for print-setup-url * allow tests to setup multiple users via POST /api/setup * remove unused function hasSetupToken * Adds a test to enforce a single creation only - we now throw an ex-info with status-code 403 when has-user-setup and /api/setup route is hit (with error message mentioning the route) - more code review responses - fixup test to not delete users, (or set locale to spanish...) * addressing code review concerns - *disallow... -> *allow... for the dynamic var name - has-user-settings test: do not assume the test db has users in it - update test
Showing
- frontend/src/metabase/lib/settings.ts 3 additions, 2 deletionsfrontend/src/metabase/lib/settings.ts
- frontend/src/metabase/routes.jsx 3 additions, 3 deletionsfrontend/src/metabase/routes.jsx
- src/metabase/api/setup.clj 19 additions, 9 deletionssrc/metabase/api/setup.clj
- src/metabase/core.clj 9 additions, 4 deletionssrc/metabase/core.clj
- src/metabase/models/setting.clj 1 addition, 1 deletionsrc/metabase/models/setting.clj
- src/metabase/setup.clj 17 additions, 8 deletionssrc/metabase/setup.clj
- test/metabase/api/setup_test.clj 47 additions, 11 deletionstest/metabase/api/setup_test.clj
Please register or sign in to comment