mirror of
https://github.com/versia-pub/frontend.git
synced 2026-03-13 11:39:16 +01:00
refactor: ♻️ Disable Nuxt component auto-importing (obscures code flow)
This commit is contained in:
parent
32d1acb4c1
commit
e309c56a86
58 changed files with 440 additions and 292 deletions
|
|
@ -13,25 +13,25 @@
|
|||
</div>
|
||||
|
||||
<VeeField name="identifier" as="div" v-slot="{ errorMessage, field }" validate-on-change>
|
||||
<InputsField>
|
||||
<InputsLabelAndError>
|
||||
<InputsLabel for="identifier">Username or Email</InputsLabel>
|
||||
<InputsError v-if="errorMessage">{{ errorMessage }}</InputsError>
|
||||
</InputsLabelAndError>
|
||||
<InputsText id="identifier" placeholder="joemama" autocomplete="email username" required
|
||||
<Field>
|
||||
<LabelAndError>
|
||||
<Label for="identifier">Username or Email</Label>
|
||||
<FieldError v-if="errorMessage">{{ errorMessage }}</FieldError>
|
||||
</LabelAndError>
|
||||
<TextInput id="identifier" placeholder="joemama" autocomplete="email username" required
|
||||
v-bind="field" :is-invalid="!!errorMessage" />
|
||||
</InputsField>
|
||||
</Field>
|
||||
</VeeField>
|
||||
|
||||
<VeeField name="password" as="div" v-slot="{ errorMessage, field }" validate-on-change>
|
||||
<InputsField>
|
||||
<InputsLabelAndError>
|
||||
<InputsLabel for="password">Password</InputsLabel>
|
||||
<InputsError v-if="errorMessage">{{ errorMessage }}</InputsError>
|
||||
</InputsLabelAndError>
|
||||
<InputsPassword id="password" placeholder="hunter2" autocomplete="current-password" required
|
||||
<Field>
|
||||
<LabelAndError>
|
||||
<Label for="password">Password</Label>
|
||||
<FieldError v-if="errorMessage">{{ errorMessage }}</FieldError>
|
||||
</LabelAndError>
|
||||
<PasswordInput id="password" placeholder="hunter2" autocomplete="current-password" required
|
||||
v-bind="field" :is-invalid="!!errorMessage" />
|
||||
</InputsField>
|
||||
</Field>
|
||||
</VeeField>
|
||||
|
||||
<div v-if="ssoConfig && ssoConfig.providers.length > 0" class="w-full space-y-3">
|
||||
|
|
@ -42,13 +42,13 @@
|
|||
<div class="grid md:grid-cols-2 md:[&:has(>:last-child:nth-child(1))]:grid-cols-1 gap-4 w-full">
|
||||
<a v-for="provider of ssoConfig.providers" :key="provider.id"
|
||||
:href="`/oauth/sso?issuer=${provider.id}&redirect_uri=${params.redirect_uri}&response_type=${params.response_type}&client_id=${params.client_id}&scope=${params.scope}`">
|
||||
<ButtonsSecondary class="flex flex-row w-full items-center justify-center gap-3">
|
||||
<ButtonSecondary class="flex flex-row w-full items-center justify-center gap-3">
|
||||
<img crossorigin="anonymous" :src="provider.icon" :alt="`${provider.name}'s logo'`"
|
||||
class="w-6 h-6" />
|
||||
<div class="flex flex-col gap-0 justify-center">
|
||||
<h3 class="font-bold">{{ provider.name }}</h3>
|
||||
</div>
|
||||
</ButtonsSecondary>
|
||||
</ButtonSecondary>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -58,7 +58,7 @@
|
|||
here, please close this page.
|
||||
</p>
|
||||
|
||||
<ButtonsPrimary type="submit" class="w-full">Sign in</ButtonsPrimary>
|
||||
<ButtonPrimary type="submit" class="w-full">Sign in</ButtonPrimary>
|
||||
</VeeForm>
|
||||
</div>
|
||||
<div v-else class="mx-auto max-w-md">
|
||||
|
|
@ -100,6 +100,14 @@
|
|||
import { LysandClient } from "@lysand-org/client";
|
||||
import { toTypedSchema } from "@vee-validate/zod";
|
||||
import { z } from "zod";
|
||||
import ButtonPrimary from "~/components/buttons/button-primary.vue";
|
||||
import ButtonSecondary from "~/components/buttons/button-secondary.vue";
|
||||
import FieldError from "~/components/inputs/field-error.vue";
|
||||
import Field from "~/components/inputs/field.vue";
|
||||
import LabelAndError from "~/components/inputs/label-and-error.vue";
|
||||
import Label from "~/components/inputs/label.vue";
|
||||
import PasswordInput from "~/components/inputs/password-input.vue";
|
||||
import TextInput from "~/components/inputs/text-input.vue";
|
||||
|
||||
const schema = toTypedSchema(
|
||||
z.object({
|
||||
|
|
|
|||
|
|
@ -40,9 +40,9 @@
|
|||
</div>
|
||||
|
||||
<div class="flex flex-col gap-3">
|
||||
<ButtonsPrimary type="submit">Authorize</ButtonsPrimary>
|
||||
<ButtonPrimary type="submit">Authorize</ButtonPrimary>
|
||||
<NuxtLink href="/" class="w-full">
|
||||
<ButtonsSecondary class="w-full">Cancel</ButtonsSecondary>
|
||||
<ButtonSecondary class="w-full">Cancel</ButtonSecondary>
|
||||
</NuxtLink>
|
||||
</div>
|
||||
</form>
|
||||
|
|
@ -83,6 +83,9 @@
|
|||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import ButtonPrimary from "~/components/buttons/button-primary.vue";
|
||||
import ButtonSecondary from "~/components/buttons/button-secondary.vue";
|
||||
|
||||
const url = useRequestURL();
|
||||
const params = useUrlSearchParams();
|
||||
|
||||
|
|
|
|||
|
|
@ -14,32 +14,32 @@
|
|||
</div>
|
||||
|
||||
<VeeField name="password" v-slot="{ errorMessage, field }" validate-on-change>
|
||||
<InputsField>
|
||||
<InputsLabelAndError>
|
||||
<InputsLabel for="password">New password</InputsLabel>
|
||||
<InputsError v-if="errorMessage">{{ errorMessage }}</InputsError>
|
||||
</InputsLabelAndError>
|
||||
<InputsPassword id="password" placeholder="hunter2" autocomplete="new-password" required
|
||||
<Field>
|
||||
<LabelAndError>
|
||||
<Label for="password">New password</Label>
|
||||
<FieldError v-if="errorMessage">{{ errorMessage }}</FieldError>
|
||||
</LabelAndError>
|
||||
<PasswordInput id="password" placeholder="hunter2" autocomplete="new-password" required
|
||||
v-bind="field" :is-invalid="!!errorMessage" :show-strength="true" />
|
||||
</InputsField>
|
||||
</Field>
|
||||
</VeeField>
|
||||
|
||||
<VeeField name="password-confirm" as="div" v-slot="{ errors, field }" validate-on-change>
|
||||
<InputsField>
|
||||
<InputsLabelAndError>
|
||||
<InputsLabel for="password-confirm">Confirm password</InputsLabel>
|
||||
<InputsError v-if="errors.length > 0">{{ errors[0] }}</InputsError>
|
||||
</InputsLabelAndError>
|
||||
<InputsPassword id="password-confirm" placeholder="hunter2" autocomplete="new-password" required
|
||||
<Field>
|
||||
<LabelAndError>
|
||||
<Label for="password-confirm">Confirm password</Label>
|
||||
<FieldError v-if="errors.length > 0">{{ errors[0] }}</FieldError>
|
||||
</LabelAndError>
|
||||
<PasswordInput id="password-confirm" placeholder="hunter2" autocomplete="new-password" required
|
||||
v-bind="field" :is-invalid="errors.length > 0" />
|
||||
</InputsField>
|
||||
</Field>
|
||||
</VeeField>
|
||||
|
||||
<p class="text-xs font-semibold text-red-300">This will reset your
|
||||
password. Make sure to put it in a password manager.
|
||||
</p>
|
||||
|
||||
<ButtonsPrimary type="submit" class="w-full">Reset</ButtonsPrimary>
|
||||
<ButtonPrimary type="submit" class="w-full">Reset</ButtonPrimary>
|
||||
</VeeForm>
|
||||
</div>
|
||||
<div v-else-if="params.success">
|
||||
|
|
@ -69,6 +69,12 @@
|
|||
<script setup lang="ts">
|
||||
import { toTypedSchema } from "@vee-validate/zod";
|
||||
import { z } from "zod";
|
||||
import ButtonPrimary from "~/components/buttons/button-primary.vue";
|
||||
import FieldError from "~/components/inputs/field-error.vue";
|
||||
import Field from "~/components/inputs/field.vue";
|
||||
import LabelAndError from "~/components/inputs/label-and-error.vue";
|
||||
import Label from "~/components/inputs/label.vue";
|
||||
import PasswordInput from "~/components/inputs/password-input.vue";
|
||||
|
||||
const identity = useCurrentIdentity();
|
||||
identity.value = null;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue