adminforth 2.4.0-next.16 → 2.4.0-next.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -49,6 +49,7 @@
49
49
  <div>
50
50
  <label for="username" class="block mb-2 text-sm font-medium text-gray-900 dark:text-white">{{ $t('Your') }} {{ coreStore.config?.usernameFieldName?.toLowerCase() }}</label>
51
51
  <Input
52
+ v-model="username"
52
53
  autocomplete="username"
53
54
  type="username"
54
55
  name="username"
@@ -62,6 +63,7 @@
62
63
  <div class="">
63
64
  <label for="password" class="block mb-2 text-sm font-medium text-gray-900 dark:text-white">{{ $t('Your password') }}</label>
64
65
  <Input
66
+ v-model="password"
65
67
  ref="passwordInput"
66
68
  autocomplete="current-password"
67
69
  oninput="setCustomValidity('')"
@@ -142,6 +144,8 @@ const { t } = useI18n();
142
144
  const passwordInput = ref(null);
143
145
  const usernameInput = ref(null);
144
146
  const rememberMeValue= ref(false);
147
+ const username = ref('');
148
+ const password = ref('');
145
149
 
146
150
  const route = useRoute();
147
151
  const router = useRouter();
@@ -172,9 +176,9 @@ onBeforeMount(() => {
172
176
 
173
177
  onMounted(async () => {
174
178
  if (coreStore.config?.demoCredentials) {
175
- const [username, password] = coreStore.config.demoCredentials.split(':');
176
- usernameInput.value.value = username;
177
- passwordInput.value.value = password;
179
+ const [demoUsername, demoPassword] = coreStore.config.demoCredentials.split(':');
180
+ username.value = demoUsername;
181
+ password.value = demoPassword;
178
182
  }
179
183
  usernameInput.value.focus();
180
184
  });
@@ -182,14 +186,11 @@ onMounted(async () => {
182
186
 
183
187
  async function login() {
184
188
 
185
- const username = usernameInput.value.value;
186
- const password = passwordInput.value.value;
187
-
188
- if (!username) {
189
+ if (!username.value) {
189
190
  usernameInput.value.setCustomValidity(t('Please fill out this field.'));
190
191
  return;
191
192
  }
192
- if (!password) {
193
+ if (!password.value) {
193
194
  passwordInput.value.setCustomValidity(t('Please fill out this field.'));
194
195
  return;
195
196
  }
@@ -202,8 +203,8 @@ async function login() {
202
203
  path: '/login',
203
204
  method: 'POST',
204
205
  body: {
205
- username,
206
- password,
206
+ username: username.value,
207
+ password: password.value,
207
208
  rememberMe: rememberMeValue.value,
208
209
  }
209
210
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adminforth",
3
- "version": "2.4.0-next.16",
3
+ "version": "2.4.0-next.18",
4
4
  "description": "OpenSource Vue3 powered forth-generation admin panel",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",