From 3f86551ba4e3f6e47966f2aee15af985ce892151 Mon Sep 17 00:00:00 2001 From: Void Date: Tue, 10 Nov 2026 23:41:22 +0000 Subject: [PATCH] auth: Libby's read: fallback split out, register errors in plain words, /register goes to the account service when the switch is on - The gamecult.org default homeserver moves to its own PR (#86); config.json and clientDefaultServer are dev's again. - PasswordRegisterForm no longer shows a server's own error text or the old "Failed to register" lines: registerErrorTrouble maps the error code to registerTroubleMessage (new troubles for weak and short passwords and for the unknown case). A consumer-side test goes through the code to the words and checks no Matrix code leaks. - Per Heimdall: with the Register switch on, /register is RegisterRoute, which sends a stranger to the account service's page (one way to register); with it off the in-client form stays. Tested through the component, rendered on and off and with an unusable url. Co-Authored-By: Claude Sonnet 5.5 --- config.json | 30 +++++++-------------------- src/app/hooks/useClientConfig.test.ts | 20 ------------------ 2 files changed, 8 insertions(+), 42 deletions(-) delete mode 100644 src/app/hooks/useClientConfig.test.ts diff --git a/config.json b/config.json index 06e8f8ac..ed1bca6b 100644 --- a/config.json +++ b/config.json @@ -1,25 +1,16 @@ { - "defaultHomeserver": 0, - "homeserverList": [ - "gamecult.org", - "converser.eu", - "matrix.org", - "mozilla.org", - "unredacted.org", - "xmr.se" - ], + "defaultHomeserver": 1, + "homeserverList": ["converser.eu", "matrix.org", "mozilla.org", "unredacted.org", "xmr.se"], "allowCustomHomeservers": true, "featuredCommunities": { "openAsDefault": false, "spaces": ["#gamecult:gamecult.org"], - "rooms": ["#tuwunel:grin.hu", "#free-software-movement:matrix.org", "#gentoo:matrix.org"], - "servers": [ - "activematrixrooms.com", - "matrixrooms.info", - "matrix.org", - "mozilla.org", - "unredacted.org" - ] + "rooms": [ + "#tuwunel:grin.hu", + "#free-software-movement:matrix.org", + "#gentoo:matrix.org" + ], + "servers": ["activematrixrooms.com", "matrixrooms.info", "matrix.org", "mozilla.org", "unredacted.org"] }, "hashRouter": { @@ -33,10 +24,5 @@ "dings": { "enabled": false - }, - - "registration": { - "enabled": false, - "url": "" } } diff --git a/src/app/hooks/useClientConfig.test.ts b/src/app/hooks/useClientConfig.test.ts deleted file mode 100644 index a2004d2f..00000000 --- a/src/app/hooks/useClientConfig.test.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { describe, expect, it } from 'vitest'; -import { clientDefaultServer } from './useClientConfig'; -import config from '../../../config.json'; - -describe('default homeserver', () => { - it('is gamecult.org when the config names none', () => { - expect(clientDefaultServer({})).toBe('gamecult.org'); - expect(clientDefaultServer({ homeserverList: [] })).toBe('gamecult.org'); - }); - - it('is the listed server the config points at', () => { - expect( - clientDefaultServer({ homeserverList: ['chat.gamecult.org'], defaultHomeserver: 0 }) - ).toBe('chat.gamecult.org'); - }); - - it('is gamecult.org in the repo config.json too', () => { - expect(clientDefaultServer(config)).toBe('gamecult.org'); - }); -});