Skip to content

Commit

Permalink
added option for ntfy access tokens
Browse files Browse the repository at this point in the history
  • Loading branch information
sharknoon committed Mar 8, 2023
1 parent 2dedc1c commit e8814e8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions server/notification-providers/ntfy.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ class Ntfy extends NotificationProvider {
headers = {
"Authorization": "Basic " + Buffer.from(notification.ntfyusername + ":" + notification.ntfypassword).toString("base64"),
};
} else if (notification.ntfyaccesstoken) {
headers = {
"Authorization": "Bearer " + notification.ntfyaccesstoken,
};
}
let data = {
"topic": notification.ntfytopic,
Expand Down
6 changes: 6 additions & 0 deletions src/components/notifications/Ntfy.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@
<HiddenInput id="ntfy-password" v-model="$parent.notification.ntfypassword" autocomplete="new-password"></HiddenInput>
</div>
</div>
<div class="mb-3">
<label for="ntfy-access-token" class="form-label">{{ $t("Access Token") }} ({{ $t("Optional") }})</label>
<div class="input-group mb-3">
<HiddenInput id="ntfy-access-token" v-model="$parent.notification.ntfyaccesstoken"></HiddenInput>
</div>
</div>
<div class="mb-3">
<label for="ntfy-icon" class="form-label">{{ $t("IconUrl") }}</label>
<input id="ntfy-icon" v-model="$parent.notification.ntfyIcon" type="text" class="form-control">
Expand Down

0 comments on commit e8814e8

Please sign in to comment.