refactor: users are not a requirement when using oauth

This commit is contained in:
Stavros
2025-01-26 20:45:34 +02:00
parent 08d382c981
commit a243f22ac8
5 changed files with 57 additions and 36 deletions

View File

@@ -153,40 +153,44 @@ export const LoginPage = () => {
</Grid.Col>
)}
</Grid>
<Divider
label="Or continue with password"
labelPosition="center"
my="lg"
/>
{configuredProviders.includes("username") && (
<Divider
label="Or continue with password"
labelPosition="center"
my="lg"
/>
)}
</>
)}
<form onSubmit={form.onSubmit(handleSubmit)}>
<TextInput
label="Username"
placeholder="user@example.com"
required
disabled={loginMutation.isLoading}
key={form.key("username")}
{...form.getInputProps("username")}
/>
<PasswordInput
label="Password"
placeholder="password"
required
mt="md"
disabled={loginMutation.isLoading}
key={form.key("password")}
{...form.getInputProps("password")}
/>
<Button
fullWidth
mt="xl"
type="submit"
loading={loginMutation.isLoading}
>
Login
</Button>
</form>
{configuredProviders.includes("username") && (
<form onSubmit={form.onSubmit(handleSubmit)}>
<TextInput
label="Username"
placeholder="user@example.com"
required
disabled={loginMutation.isLoading}
key={form.key("username")}
{...form.getInputProps("username")}
/>
<PasswordInput
label="Password"
placeholder="password"
required
mt="md"
disabled={loginMutation.isLoading}
key={form.key("password")}
{...form.getInputProps("password")}
/>
<Button
fullWidth
mt="xl"
type="submit"
loading={loginMutation.isLoading}
>
Login
</Button>
</form>
)}
</Paper>
</Layout>
);