Skip to content

Use textfield with visible key for API key generation #250

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 6, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions src/components/ApiKeyManagement.vue
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,16 @@
/>
</v-card-text>
<v-card-text v-else>
This is the only time your API key will be accessable. Please copy it to your clipboard now and store it
This is the only time your API key will be accessible. Please copy it to your clipboard now and store it
in a secure location. You'll need it to access the API and won't be able to retrieve it again later.
<br />
<div class="d-flex justify-center">
<v-btn class="mt-6" @click="copyApiKey(newApiKeyToken, isActive)" prepend-icon="mdi-content-copy"
>Copy API key to clipboard</v-btn
>
</div>
<v-text-field
class="mt-3"
v-model="newApiKeyToken"
append-inner-icon="mdi-content-copy"
@click="copyApiKey(newApiKeyToken)"
hint="Click the textfield to copy the key to your clipboard"
persistent-hint
></v-text-field>
</v-card-text>
<v-card-actions v-if="!newApiKeyToken">
<v-spacer></v-spacer>
Expand Down Expand Up @@ -170,14 +172,12 @@ export default {
})
.finally(() => {});
},
copyApiKey(text, isActive) {
copyApiKey(text) {
navigator.clipboard.writeText(text);
this.$eventBus.emit("displayMessage", {
status: "info",
message: "API key copied to clipboard!"
});
this.newApiKeyToken = null;
isActive.value = false;
}
}
};
Expand Down