Skip to content

Commit da9d05f

Browse files
committed
fix: readonly inputs only for generated tokens
1 parent c64b9a6 commit da9d05f

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

src/components/Callback.vue

+2-2
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,12 @@ async function fetchTokens(code: string) {
7272
<div class="form-item">
7373
<span class="whitespace-nowrap">Access Token</span>
7474
<Skeleton v-if="!accessToken" class="w-full h-8 rounded-md"></Skeleton>
75-
<PasswordInput v-else v-model="accessToken"></PasswordInput>
75+
<PasswordInput v-else v-model="accessToken" readonly></PasswordInput>
7676
</div>
7777
<div class="form-item">
7878
<span class="whitespace-nowrap">Refresh Token</span>
7979
<Skeleton v-if="!refreshToken" class="w-full h-8 rounded-md"></Skeleton>
80-
<PasswordInput v-else v-model="refreshToken"></PasswordInput>
80+
<PasswordInput v-else v-model="refreshToken" readonly></PasswordInput>
8181
</div>
8282
</div>
8383
</DialogContent>

src/components/ui/input/password-input.vue

+5-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ const value = defineModel<string>({ required: true })
1010
const type = ref('password')
1111
const { toast } = useToast()
1212
13+
defineProps<{
14+
readonly?: boolean
15+
}>()
16+
1317
function switchType() {
1418
type.value = type.value === 'password' ? 'text' : 'password'
1519
}
@@ -29,7 +33,7 @@ async function copy() {
2933

3034
<template>
3135
<div class="relative w-full items-center">
32-
<Input :type class="pr-10 outline-none" v-model="value" autocomplete="off" readonly />
36+
<Input :type class="pr-10 outline-none" v-model="value" autocomplete="off" :readonly />
3337

3438
<div class="absolute end-0 inset-y-0 flex items-center justify-center px-2">
3539
<Button @click="switchType" size="icon" variant="ghost">

0 commit comments

Comments
 (0)