Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/add_hide_user_pass_fields.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
sable: minor
---

Added config option `hideUsernamePasswordFields` for hosts to hide username and password fields from login page.
1 change: 1 addition & 0 deletions config.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"elementCallUrl": null,

"disableAccountSwitcher": false,
"hideUsernamePasswordFields": false,

"pushNotificationDetails": {
"pushNotifyUrl": "https://cinny.cc/_matrix/push/v1/notify",
Expand Down
1 change: 1 addition & 0 deletions src/app/hooks/useClientConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export type ClientConfig = {
elementCallUrl?: string;

disableAccountSwitcher?: boolean;
hideUsernamePasswordFields?: boolean;

pushNotificationDetails?: {
pushNotifyUrl?: string;
Expand Down
3 changes: 2 additions & 1 deletion src/app/pages/auth/login/Login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ const useLoginSearchParams = (searchParams: URLSearchParams): LoginPathSearchPar
export function Login() {
const server = useAuthServer();
const { hashRouter } = useClientConfig();
const { hideUsernamePasswordFields } = useClientConfig();
const { loginFlows } = useAuthFlows();
const [searchParams] = useSearchParams();
const loginSearchParams = useLoginSearchParams(searchParams);
Expand All @@ -62,7 +63,7 @@ export function Login() {
{parsedFlows.token && loginSearchParams.loginToken && (
<TokenLogin token={loginSearchParams.loginToken} />
)}
{parsedFlows.password && (
{!hideUsernamePasswordFields && parsedFlows.password && (
<>
<PasswordLoginForm
defaultUsername={loginSearchParams.username}
Expand Down
Loading