release: v1.4.4
docs / build (push) Canceled after 0s
docs / deploy (push) Canceled after 0s
Publish Docker image / build (linux/amd64, ubuntu-latest, amd64) (push) Canceled after 0s
Publish Docker image / build (linux/arm64, ubuntu-24.04-arm, arm64) (push) Canceled after 0s
Publish Docker image / merge (push) Canceled after 0s
GitHub Release / release (push) Canceled after 0s
ci / ci (22, ubuntu-latest) (push) Canceled after 0s
docs / build (push) Canceled after 0s
docs / deploy (push) Canceled after 0s
Publish Docker image / build (linux/amd64, ubuntu-latest, amd64) (push) Canceled after 0s
Publish Docker image / build (linux/arm64, ubuntu-24.04-arm, arm64) (push) Canceled after 0s
Publish Docker image / merge (push) Canceled after 0s
GitHub Release / release (push) Canceled after 0s
ci / ci (22, ubuntu-latest) (push) Canceled after 0s
Update Cap login verification so hashwx challenges solve, while older SHA-256 keys still work.
This commit is contained in:
1 parent
424bfd9090
commit
05cc3895f1
7 files changed
+56
-10
No files matched your search
@@ -1,6 +1,4 @@
|
||||
<script setup lang="ts">
|
||||
import 'cap-widget'
|
||||
|
||||
const props = defineProps<{
|
||||
apiEndpoint: string
|
||||
}>()
|
||||
@@ -13,6 +11,19 @@ const emit = defineEmits<{
|
||||
const { t } = useI18n()
|
||||
|
||||
const widgetRef = ref<HTMLElement | null>(null)
|
||||
const ready = ref(false)
|
||||
|
||||
onMounted(async () => {
|
||||
const capWindow = window as Window & {
|
||||
CAP_CUSTOM_WASM_URL?: string
|
||||
CAP_CUSTOM_HASHWX_URL?: string
|
||||
}
|
||||
// SHA-256 与 hashwx 的求解器都放在本站 /cap,避免组件去 jsDelivr 拉 wasm。
|
||||
capWindow.CAP_CUSTOM_WASM_URL = '/cap/cap_wasm_bg.wasm'
|
||||
capWindow.CAP_CUSTOM_HASHWX_URL = '/cap/hashwx.wasm'
|
||||
await import('cap-widget')
|
||||
ready.value = true
|
||||
})
|
||||
|
||||
function onSolve(event: Event) {
|
||||
const token = (event as CustomEvent<{ token: string }>).detail?.token
|
||||
@@ -37,6 +48,7 @@ defineExpose({ reset })
|
||||
<template>
|
||||
<ClientOnly>
|
||||
<cap-widget
|
||||
v-if="ready"
|
||||
ref="widgetRef"
|
||||
:data-cap-api-endpoint="props.apiEndpoint"
|
||||
:data-cap-i18n-initial-state="t('auth.capInitialState')"
|
||||
|
||||
Reference in new issue
Block a user