mattermost-mobile-upstream/app/screens/edit_server
Felipe Martin c189ca9fdd
MM-70606: Fix Edit Server pre-auth secret save on HTTPS-redirecting servers (#10252)
* fix(MM-70606): send the pre-auth secret over HTTPS only and fix Edit Server save

- sanitizeUrl: useHttp no longer downgrades an explicit https:// URL, so
  getServerUrlAfterRedirect keeps an HTTPS redirect target and strips its
  query string.
- Send the pre-auth secret header only to https/wss URLs: REST client
  default headers, per-request headers, WebSocket, and the HEAD probe.
  The secret is still persisted for the server.
- Edit Server: try HTTPS first, then fall back to HTTP (as Add Server does).
- Edit Server: recreate and reconnect the WebSocket client after the
  secret changes, so the new secret is used without an app restart.

* fix(MM-70606): keep the persisted pre-auth secret on token refresh over HTTP

ClientTracking stores the secret in its own field. The token refresh in
doFetchWithTracking reads that field instead of the request header, which
is only set over TLS, so a refresh on an http:// server no longer resets
the saved secret.

* fix(MM-70606): clarify when the pre-auth secret header is removed

* test(MM-70606): cover the pre-auth header guard in NetworkManager.createClient
2026-10-30 12:54:39 +01:00
..
edit_server.tsx MM-70606: Fix Edit Server pre-auth secret save on HTTPS-redirecting servers (#10252) 2026-10-30 12:54:39 +01:00
form.tsx Migrate from RNN to Expo router (#9402) 2026-05-13 17:44:55 +08:00
header.tsx feat: edit server pre-authentication secret (#9128) 2025-11-12 16:07:19 +01:00
index.ts Migrate from RNN to Expo router (#9402) 2026-05-13 17:44:55 +08:00
restore_preauth_secret.test.ts [MM-70605][MM-70607] Scope pre-auth secret storage per server (#10149) 2026-10-23 12:02:41 +02:00
restore_preauth_secret.ts [MM-70605][MM-70607] Scope pre-auth secret storage per server (#10149) 2026-10-23 12:02:41 +02:00