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 >
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 >
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 >
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" ;
97114import { breakpointsTailwind , useBreakpoints } from " @vueuse/core" ;
98115
99116import AddRecoveryMethodModal from " ~/components/account-recovery/AddRecoveryMethodModal.vue" ;
@@ -106,27 +123,38 @@ const breakpoints = useBreakpoints(breakpointsTailwind);
106123const isMobile = breakpoints .smaller (" lg" );
107124const { address : accountAddress } = useAccountStore ();
108125const { getGuardiansInProgress, getGuardians, getGuardiansData, removeGuardian, removeGuardianInProgress } = useRecoveryGuardian ();
126+ const { getOidcAccounts, getOidcAccountsData, getOidcAccountsInProgress } = useRecoveryOidc ();
109127
110128const config = useRuntimeConfig ();
111129
112130const appUrl = config .public .appUrl ;
113131
114- const recoveryMethods = computed (() => (getGuardiansData .value ?? []).map ((x ) => ({
115- method: " Guardian" ,
116- address: x .addr ,
117- addedOn: new Date (),
118- ... (! x .isReady && { pendingUrl: ` ${appUrl }/recovery/guardian/confirm-guardian?accountAddress=${accountAddress }&guardianAddress=${x .addr } ` }),
119- })));
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+ ]);
120146
121147const refreshGuardians = () => {
122148 if (accountAddress ) {
123149 getGuardians (accountAddress );
150+ getOidcAccounts (accountAddress );
124151 }
125152};
126153
127154watchEffect (async () => {
128155 if (accountAddress ) {
129156 await getGuardians (accountAddress );
157+ await getOidcAccounts (accountAddress );
130158 }
131159});
132160 </script >
0 commit comments