@adminforth/two-factors-auth 1.11.1 → 2.0.0

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.
package/build.log CHANGED
@@ -13,5 +13,5 @@ custom/package.json
13
13
  custom/tsconfig.json
14
14
  custom/utils.js
15
15
 
16
- sent 68,512 bytes received 172 bytes 137,368.00 bytes/sec
17
- total size is 67,872 speedup is 0.99
16
+ sent 68,412 bytes received 172 bytes 137,168.00 bytes/sec
17
+ total size is 67,772 speedup is 0.99
@@ -165,7 +165,7 @@
165
165
  </div>
166
166
  </template>
167
167
 
168
- <script setup lang="ts">
168
+ <script setup lang="ts">
169
169
  import { Table } from '@/afcl'
170
170
  import { callAdminForthApi } from '@/utils';
171
171
  import adminforth from '@/adminforth';
@@ -176,12 +176,10 @@
176
176
  import utc from 'dayjs/plugin/utc';
177
177
  import timezone from 'dayjs/plugin/timezone';
178
178
  import { useCoreStore } from '@/stores/core';
179
- import { useUserStore } from '@/stores/user'
180
179
 
181
180
  dayjs.extend(utc);
182
181
  dayjs.extend(timezone);
183
182
  const coreStore = useCoreStore();
184
- const userStore = useUserStore();
185
183
  const passkeys = ref([]);
186
184
  const isPasskeySupported = ref(false);
187
185
  const passkeysNewName = ref('');
@@ -204,14 +202,12 @@
204
202
  const fetchedOptions = ref(null);
205
203
 
206
204
  onMounted(async () => {
207
- if (userStore.isAuthorized === true ) {
208
- await getPasskeys();
209
- await checkForCompatibility();
210
- if (authenticatorAttachment.value === "cross-platform") {
211
- addPasskeyMode.value = 'cross-platform';
212
- }
213
- isInitialFinished.value = true;
214
- }
205
+ await getPasskeys();
206
+ await checkForCompatibility();
207
+ if (authenticatorAttachment.value === "cross-platform") {
208
+ addPasskeyMode.value = 'cross-platform';
209
+ }
210
+ isInitialFinished.value = true;
215
211
  });
216
212
 
217
213
  onMounted(() => {
@@ -276,7 +272,9 @@
276
272
  authenticatorAttachment.value = response.authenticatorAttachment;
277
273
  } catch (error) {
278
274
  console.error('Error fetching passkeys:', error);
279
- adminforth.alert({message: 'Error fetching passkeys.', variant: 'warning'});
275
+ if ( coreStore.adminUser.username ) {
276
+ adminforth.alert({message: 'Error fetching passkeys.', variant: 'warning'});
277
+ }
280
278
  }
281
279
  }
282
280
 
@@ -165,7 +165,7 @@
165
165
  </div>
166
166
  </template>
167
167
 
168
- <script setup lang="ts">
168
+ <script setup lang="ts">
169
169
  import { Table } from '@/afcl'
170
170
  import { callAdminForthApi } from '@/utils';
171
171
  import adminforth from '@/adminforth';
@@ -176,12 +176,10 @@
176
176
  import utc from 'dayjs/plugin/utc';
177
177
  import timezone from 'dayjs/plugin/timezone';
178
178
  import { useCoreStore } from '@/stores/core';
179
- import { useUserStore } from '@/stores/user'
180
179
 
181
180
  dayjs.extend(utc);
182
181
  dayjs.extend(timezone);
183
182
  const coreStore = useCoreStore();
184
- const userStore = useUserStore();
185
183
  const passkeys = ref([]);
186
184
  const isPasskeySupported = ref(false);
187
185
  const passkeysNewName = ref('');
@@ -204,14 +202,12 @@
204
202
  const fetchedOptions = ref(null);
205
203
 
206
204
  onMounted(async () => {
207
- if (userStore.isAuthorized === true ) {
208
- await getPasskeys();
209
- await checkForCompatibility();
210
- if (authenticatorAttachment.value === "cross-platform") {
211
- addPasskeyMode.value = 'cross-platform';
212
- }
213
- isInitialFinished.value = true;
214
- }
205
+ await getPasskeys();
206
+ await checkForCompatibility();
207
+ if (authenticatorAttachment.value === "cross-platform") {
208
+ addPasskeyMode.value = 'cross-platform';
209
+ }
210
+ isInitialFinished.value = true;
215
211
  });
216
212
 
217
213
  onMounted(() => {
@@ -276,7 +272,9 @@
276
272
  authenticatorAttachment.value = response.authenticatorAttachment;
277
273
  } catch (error) {
278
274
  console.error('Error fetching passkeys:', error);
279
- adminforth.alert({message: 'Error fetching passkeys.', variant: 'warning'});
275
+ if ( coreStore.adminUser.username ) {
276
+ adminforth.alert({message: 'Error fetching passkeys.', variant: 'warning'});
277
+ }
280
278
  }
281
279
  }
282
280
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adminforth/two-factors-auth",
3
- "version": "1.11.1",
3
+ "version": "2.0.0",
4
4
  "description": "AdminForth plugin for two factors authentication",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",