Skip to content

Commit f37ca43

Browse files
committed
feat: add oidc recovery card
add oidc recovery card
1 parent ce1ac89 commit f37ca43

File tree

1 file changed

+35
-10
lines changed
  • packages/auth-server/pages/dashboard/settings

1 file changed

+35
-10
lines changed

packages/auth-server/pages/dashboard/settings/index.vue

Lines changed: 35 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
<Card
2626
v-for="method in recoveryMethods"
2727
:key="method.address"
28-
:loading="getGuardiansInProgress && removeGuardianInProgress"
28+
:loading="getGuardiansInProgress && removeGuardianInProgress && getOidcAccountsInProgress"
2929
class="p-6"
3030
:class="{ 'border-yellow-400 bg-yellow-50 dark:bg-yellow-950 dark:border-yellow-600': method.pendingUrl }"
3131
>
@@ -42,14 +42,30 @@
4242
(Pending)
4343
</span>
4444
</div>
45-
<div class="flex items-center gap-3 text-gray-600 dark:text-gray-400">
45+
<div
46+
v-if="method.method === 'Guardian'"
47+
class="flex items-center gap-3 text-gray-600 dark:text-gray-400"
48+
>
4649
<WalletIcon class="w-5 h-5 flex-shrink-0" />
4750
<span class="font-mono text-sm">{{ isMobile ? shortenAddress(method.address) : method.address }}</span>
4851
<CopyToClipboard
4952
class="-ml-2"
5053
:text="method.address"
5154
/>
5255
</div>
56+
<div
57+
v-else-if="method.method === 'OIDC'"
58+
class="flex flex-col items-start gap-3 text-gray-600 dark:text-gray-400"
59+
>
60+
<div class="flex items-center gap-3">
61+
<ShieldCheckIcon class="w-5 h-5 flex-shrink-0" />
62+
<span class="font-mono text-sm">{{ method.iss }}</span>
63+
</div>
64+
<div class="flex items-center gap-3">
65+
<SparklesIcon class="w-5 h-5 flex-shrink-0" />
66+
<span class="font-mono text-sm">{{ method.digest }}</span>
67+
</div>
68+
</div>
5369
<p class="text-sm text-gray-500 dark:text-gray-500">
5470
Added on {{ method.addedOn.toLocaleDateString() }} {{ method.addedOn.toLocaleTimeString() }}
5571
</p>
@@ -79,6 +95,7 @@
7995
type="danger"
8096
class="text-sm lg:w-auto w-full"
8197
@click="removeGuardian(method.address)"
98+
v-if="method.method === 'Guardian'"
8299
>
83100
Remove
84101
</Button>
@@ -93,7 +110,7 @@
93110
</template>
94111

95112
<script setup lang="ts">
96-
import { WalletIcon } from "@heroicons/vue/24/solid";
113+
import { ShieldCheckIcon, SparklesIcon, WalletIcon } from "@heroicons/vue/24/solid";
97114
import { breakpointsTailwind, useBreakpoints } from "@vueuse/core";
98115
99116
import AddRecoveryMethodModal from "~/components/account-recovery/AddRecoveryMethodModal.vue";
@@ -106,18 +123,26 @@ const breakpoints = useBreakpoints(breakpointsTailwind);
106123
const isMobile = breakpoints.smaller("lg");
107124
const { address: accountAddress } = useAccountStore();
108125
const { getGuardiansInProgress, getGuardians, getGuardiansData, removeGuardian, removeGuardianInProgress } = useRecoveryGuardian();
109-
const { getOidcAccounts } = useRecoveryOidc();
126+
const { getOidcAccounts, getOidcAccountsData, getOidcAccountsInProgress } = useRecoveryOidc();
110127
111128
const config = useRuntimeConfig();
112129
113130
const appUrl = config.public.appUrl;
114131
115-
const recoveryMethods = computed(() => (getGuardiansData.value ?? []).map((x) => ({
116-
method: "Guardian",
117-
address: x.addr,
118-
addedOn: new Date(),
119-
...(!x.isReady && { pendingUrl: `${appUrl}/recovery/guardian/confirm-guardian?accountAddress=${accountAddress}&guardianAddress=${x.addr}` }),
120-
})));
132+
const recoveryMethods = computed(() => [
133+
...(getGuardiansData.value ?? []).map((x) => ({
134+
method: "Guardian",
135+
address: x.addr,
136+
addedOn: new Date(),
137+
...(!x.isReady && { pendingUrl: `${appUrl}/recovery/guardian/confirm-guardian?accountAddress=${accountAddress}&guardianAddress=${x.addr}` }),
138+
})),
139+
...(getOidcAccountsData.value ?? []).map((x) => ({
140+
method: "OIDC",
141+
iss: x.iss,
142+
digest: x.oidcDigest,
143+
addedOn: new Date(),
144+
})),
145+
]);
121146
122147
const refreshGuardians = () => {
123148
if (accountAddress) {

0 commit comments

Comments
 (0)