diff --git a/user/types.go b/user/types.go index 0e21e518..68747a8c 100644 --- a/user/types.go +++ b/user/types.go @@ -93,6 +93,7 @@ type Tier struct { StripePriceID string // Price ID for paid tiers (price_...) } +// Context returns fields for the log func (t *Tier) Context() log.Context { return log.Context{ "tier_id": t.ID, diff --git a/web/public/static/langs/bg.json b/web/public/static/langs/bg.json index 0c0017dc..2c1f0b19 100644 --- a/web/public/static/langs/bg.json +++ b/web/public/static/langs/bg.json @@ -114,8 +114,8 @@ "prefs_users_table_user_header": "Потребител", "prefs_users_dialog_title_edit": "Промяна на потребител", "prefs_users_dialog_base_url_label": "Адрес на услугата, e.g. https://ntfy.sh", - "prefs_users_dialog_button_cancel": "Отказ", - "prefs_users_dialog_button_save": "Запазване", + "common_cancel": "Отказ", + "common_save": "Запазване", "prefs_appearance_language_title": "Език", "subscribe_dialog_login_password_label": "Парола", "subscribe_dialog_login_button_login": "Вход", @@ -128,7 +128,7 @@ "prefs_users_dialog_title_add": "Добавяне на потребител", "prefs_notifications_delete_after_one_month": "След един месец", "prefs_users_dialog_username_label": "Потребител, напр. phil", - "prefs_users_dialog_button_add": "Добавяне", + "common_add": "Добавяне", "error_boundary_title": "О, не, ntfy се срина", "error_boundary_description": "Това очевидно не трябва да се случва. Много съжаляваме!
Ако имате минута, докладвайте в GitHub или ни уведомете в Discord или Matrix.", "error_boundary_stack_trace": "Следа от стека", diff --git a/web/public/static/langs/cs.json b/web/public/static/langs/cs.json index afdf92a7..c2ba220e 100644 --- a/web/public/static/langs/cs.json +++ b/web/public/static/langs/cs.json @@ -116,9 +116,9 @@ "prefs_users_add_button": "Přidat uživatele", "prefs_users_table_user_header": "Uživatel", "prefs_users_table_base_url_header": "URL služby", - "prefs_users_dialog_button_cancel": "Zrušit", - "prefs_users_dialog_button_add": "Přidat", - "prefs_users_dialog_button_save": "Uložit", + "common_cancel": "Zrušit", + "common_add": "Přidat", + "common_save": "Uložit", "priority_min": "nejnižší", "priority_low": "nízká", "priority_default": "výchozí", diff --git a/web/public/static/langs/de.json b/web/public/static/langs/de.json index 6c8116c5..a574daba 100644 --- a/web/public/static/langs/de.json +++ b/web/public/static/langs/de.json @@ -15,9 +15,9 @@ "prefs_notifications_min_priority_max_only": "Nur höchste Priorität", "prefs_notifications_delete_after_never": "Nie", "prefs_users_dialog_password_label": "Kennwort", - "prefs_users_dialog_button_cancel": "Abbrechen", - "prefs_users_dialog_button_add": "Hinzufügen", - "prefs_users_dialog_button_save": "Speichern", + "common_cancel": "Abbrechen", + "common_add": "Hinzufügen", + "common_save": "Speichern", "prefs_appearance_language_title": "Sprache", "notifications_none_for_any_description": "Um Benachrichtigungen an ein Thema zu senden, schicke einen PUT/POST-Request an die Themen-URL. Hier ist ein Beispiel mit einem Deiner Themen.", "publish_dialog_message_placeholder": "Gib hier eine Nachricht ein", diff --git a/web/public/static/langs/en.json b/web/public/static/langs/en.json index 2bfc60df..04f98e40 100644 --- a/web/public/static/langs/en.json +++ b/web/public/static/langs/en.json @@ -1,6 +1,7 @@ { "common_cancel": "Cancel", "common_save": "Save", + "common_add": "Add", "signup_title": "Create a ntfy account", "signup_form_username": "Username", "signup_form_password": "Password", @@ -299,9 +300,6 @@ "prefs_users_dialog_base_url_label": "Service URL, e.g. https://ntfy.sh", "prefs_users_dialog_username_label": "Username, e.g. phil", "prefs_users_dialog_password_label": "Password", - "prefs_users_dialog_button_cancel": "Cancel", - "prefs_users_dialog_button_add": "Add", - "prefs_users_dialog_button_save": "Save", "prefs_appearance_title": "Appearance", "prefs_appearance_language_title": "Language", "prefs_reservations_title": "Reserved topics", diff --git a/web/public/static/langs/es.json b/web/public/static/langs/es.json index 4fa30ca3..3f06b9d9 100644 --- a/web/public/static/langs/es.json +++ b/web/public/static/langs/es.json @@ -101,8 +101,8 @@ "prefs_users_add_button": "Añadir usuario", "prefs_users_dialog_title_edit": "Editar usuario", "prefs_users_dialog_base_url_label": "URL del servicio, ej. https://ntfy.sh", - "prefs_users_dialog_button_add": "Añadir", - "prefs_users_dialog_button_save": "Guardar", + "common_add": "Añadir", + "common_save": "Guardar", "prefs_appearance_title": "Apariencia", "prefs_appearance_language_title": "Idioma", "error_boundary_title": "Oh no, ntfy tuvo un error", @@ -134,7 +134,7 @@ "prefs_users_dialog_password_label": "Contraseña", "error_boundary_description": "Obviamente, esto no debería ocurrir. Lo sentimos mucho.
Si tienes un minuto, por favor informa de esto en GitHub, o avísanos vía Discord o Matrix.", "prefs_users_dialog_title_add": "Añadir usuario", - "prefs_users_dialog_button_cancel": "Cancelar", + "common_cancel": "Cancelar", "prefs_users_dialog_username_label": "Nombre de usuario, ej. phil", "priority_max": "máx", "priority_high": "alta", diff --git a/web/public/static/langs/fr.json b/web/public/static/langs/fr.json index d6458c8b..2304b982 100644 --- a/web/public/static/langs/fr.json +++ b/web/public/static/langs/fr.json @@ -79,7 +79,7 @@ "subscribe_dialog_subscribe_title": "S'abonner au sujet", "subscribe_dialog_login_title": "Connexion nécessaire", "prefs_notifications_min_priority_low_and_higher": "Priorité basse et au-dessus", - "prefs_users_dialog_button_cancel": "Annuler", + "common_cancel": "Annuler", "error_boundary_button_copy_stack_trace": "Copier la trace d'appels", "publish_dialog_attached_file_title": "Fichier joint :", "publish_dialog_checkbox_publish_another": "Publier un autre", @@ -128,7 +128,7 @@ "prefs_users_description": "Ajoutez/supprimez des utilisateurs pour vos sujets protégés ici. Notez que cet utilisateur et ce mot de passe sont stockés dans le stockage local du navigateur.", "prefs_users_table_user_header": "Utilisateur", "prefs_users_dialog_title_edit": "Éditer l'utilisateur", - "prefs_users_dialog_button_add": "Ajouter", + "common_add": "Ajouter", "error_boundary_description": "Ceci ne devrait évidemment pas arriver. Désolé pour ça.
Si vous avez une minute, merci de signaler ceci sur GitHub, ou faites-le nous savoir par Discord ou Matrix.", "prefs_users_dialog_title_add": "Ajouter un utilisateur", "error_boundary_stack_trace": "Trace de pile d'appels", @@ -152,7 +152,7 @@ "publish_dialog_chip_topic_label": "Changer de sujet", "publish_dialog_details_examples_description": "Pour des exemples et une description détaillée des fonctionnalités d'envoi, voir la documentation.", "publish_dialog_button_cancel_sending": "Annuler l'envoi", - "prefs_users_dialog_button_save": "Enregistrer", + "common_save": "Enregistrer", "notifications_new_indicator": "Nouvelle notification", "publish_dialog_delay_reset": "Retirer le délai de réception", "notifications_list_item": "Notification", diff --git a/web/public/static/langs/hu.json b/web/public/static/langs/hu.json index e9b9e198..975d8d97 100644 --- a/web/public/static/langs/hu.json +++ b/web/public/static/langs/hu.json @@ -108,7 +108,7 @@ "prefs_users_dialog_title_edit": "Felhasználó szerkesztése", "prefs_users_dialog_username_label": "Felhasználónév, pl: jozsi", "prefs_users_dialog_password_label": "Jelszó", - "prefs_users_dialog_button_add": "Hozzáadás", + "common_add": "Hozzáadás", "prefs_users_dialog_base_url_label": "Szerver címe, pl: https://ntfy.sh", "notifications_loading": "Értesítések betöltése …", "publish_dialog_progress_uploading": "Feltöltés …", @@ -144,8 +144,8 @@ "error_boundary_gathering_info": "Több információ…", "publish_dialog_attachment_limits_file_reached": "túllépi a fájlméret korlátot ({{fileSizeLimit}})", "prefs_users_title": "Felhasználók kezelése", - "prefs_users_dialog_button_cancel": "Mégsem", - "prefs_users_dialog_button_save": "Mentés", + "common_cancel": "Mégsem", + "common_save": "Mentés", "prefs_users_dialog_title_add": "Felhasználó hozzáadása", "prefs_appearance_language_title": "Nyelv", "priority_low": "alacsony", diff --git a/web/public/static/langs/id.json b/web/public/static/langs/id.json index 307bd17f..95f85356 100644 --- a/web/public/static/langs/id.json +++ b/web/public/static/langs/id.json @@ -19,7 +19,7 @@ "publish_dialog_message_label": "Pesan", "nav_button_settings": "Pengaturan", "nav_button_documentation": "Dokumentasi", - "prefs_users_dialog_button_add": "Tambahkan", + "common_add": "Tambahkan", "nav_topics_title": "Topik yang dilanggani", "nav_button_subscribe": "Berlangganan ke topik", "alert_grant_title": "Notifikasi dinonaktifkan", @@ -113,7 +113,7 @@ "prefs_notifications_sound_no_sound": "Tidak ada suara", "prefs_users_table_user_header": "Pengguna", "prefs_users_dialog_base_url_label": "URL Layanan, mis. https://ntfy.sh", - "prefs_users_dialog_button_save": "Simpan", + "common_save": "Simpan", "prefs_appearance_title": "Tampilan", "subscribe_dialog_login_password_label": "Kata sandi", "subscribe_dialog_login_button_back": "Kembali", @@ -131,7 +131,7 @@ "prefs_users_dialog_title_add": "Tambahkan pengguna", "prefs_users_dialog_title_edit": "Edit pengguna", "prefs_users_dialog_password_label": "Kata sandi", - "prefs_users_dialog_button_cancel": "Batal", + "common_cancel": "Batal", "error_boundary_title": "Aduh, ntfy mogok", "error_boundary_description": "Seharusnya ini tidak terjadi. Maaf sekali tentang hal ini.
Jika Anda punya beberapa menit, silakan laporkan ini di GitHub, atau beritahu kami melalui Discord atau Matrix.", "error_boundary_stack_trace": "Jejak tumpukan", diff --git a/web/public/static/langs/it.json b/web/public/static/langs/it.json index 0c26ac98..3dc40d5e 100644 --- a/web/public/static/langs/it.json +++ b/web/public/static/langs/it.json @@ -134,9 +134,9 @@ "prefs_users_dialog_base_url_label": "URL del servizio, ad es. https://ntfy.sh", "prefs_users_dialog_username_label": "Nome utente, ad es. phil", "prefs_users_dialog_password_label": "Password", - "prefs_users_dialog_button_cancel": "Annulla", - "prefs_users_dialog_button_add": "Aggiungere", - "prefs_users_dialog_button_save": "Salva", + "common_cancel": "Annulla", + "common_add": "Aggiungere", + "common_save": "Salva", "prefs_appearance_title": "Aspetto", "prefs_appearance_language_title": "Lingua", "priority_min": "min", diff --git a/web/public/static/langs/ja.json b/web/public/static/langs/ja.json index f1d0ccc0..3978478a 100644 --- a/web/public/static/langs/ja.json +++ b/web/public/static/langs/ja.json @@ -99,7 +99,7 @@ "prefs_notifications_delete_after_three_hours": "3時間後", "prefs_users_description": "保護トピックのユーザーを追加/削除できます。ユーザー名とパスワードはブラウザのローカルストレージに保存されることに留意してください。", "prefs_users_add_button": "ユーザー追加", - "prefs_users_dialog_button_add": "追加", + "common_add": "追加", "subscribe_dialog_subscribe_use_another_label": "他のサーバーを使用", "subscribe_dialog_error_user_not_authorized": "ユーザー名 {{username}} は許可されていません", "prefs_notifications_delete_after_one_week": "1週間後", @@ -118,8 +118,8 @@ "prefs_notifications_min_priority_title": "表示する優先度", "prefs_notifications_min_priority_default_and_higher": "優先度通常 およびそれ以上", "prefs_notifications_delete_after_title": "通知を削除", - "prefs_users_dialog_button_cancel": "キャンセル", - "prefs_users_dialog_button_save": "保存", + "common_cancel": "キャンセル", + "common_save": "保存", "prefs_users_table_user_header": "ユーザー名", "prefs_users_dialog_title_add": "ユーザー追加", "prefs_users_dialog_title_edit": "ユーザー編集", diff --git a/web/public/static/langs/ko.json b/web/public/static/langs/ko.json index 87be722f..67c31280 100644 --- a/web/public/static/langs/ko.json +++ b/web/public/static/langs/ko.json @@ -126,10 +126,10 @@ "prefs_users_dialog_title_add": "사용자 추가", "prefs_users_dialog_title_edit": "사용자 편집", "prefs_users_dialog_base_url_label": "서비스 URL, 예를 들면 https://ntfy.sh", - "prefs_users_dialog_button_cancel": "취소", - "prefs_users_dialog_button_save": "저장", + "common_cancel": "취소", + "common_save": "저장", "prefs_appearance_title": "표시 설정", - "prefs_users_dialog_button_add": "추가", + "common_add": "추가", "prefs_appearance_language_title": "언어", "priority_min": "최하", "priority_low": "낮음", diff --git a/web/public/static/langs/nb_NO.json b/web/public/static/langs/nb_NO.json index 2303e5a4..4c2932ba 100644 --- a/web/public/static/langs/nb_NO.json +++ b/web/public/static/langs/nb_NO.json @@ -90,7 +90,7 @@ "prefs_users_dialog_title_edit": "Rediger bruker", "prefs_users_dialog_base_url_label": "Tjeneste-nettadresse, f.eks. https://ntfy.sh", "prefs_users_dialog_password_label": "Passord", - "prefs_users_dialog_button_save": "Lagre", + "common_save": "Lagre", "prefs_appearance_title": "Utseende", "prefs_appearance_language_title": "Språk", "prefs_users_dialog_username_label": "Brukernavn, f.eks. phil", @@ -116,8 +116,8 @@ "subscribe_dialog_login_button_back": "Tilbake", "prefs_notifications_delete_after_three_hours": "Etter tre timer", "prefs_users_table_base_url_header": "Tjeneste-nettadresse", - "prefs_users_dialog_button_cancel": "Avbryt", - "prefs_users_dialog_button_add": "Legg til", + "common_cancel": "Avbryt", + "common_add": "Legg til", "publish_dialog_chip_attach_url_label": "Legg til fil med nettadresse", "publish_dialog_tags_placeholder": "Kommainndelt liste over etiketter, f.eks. advarsel, srv1-sikkerhetskopi", "prefs_notifications_sound_description_none": "Merknader spiller ikke lyd når de mottas", diff --git a/web/public/static/langs/nl.json b/web/public/static/langs/nl.json index 39ead926..ba54c820 100644 --- a/web/public/static/langs/nl.json +++ b/web/public/static/langs/nl.json @@ -177,9 +177,9 @@ "prefs_users_table_base_url_header": "Service URL", "prefs_users_dialog_base_url_label": "Service URL, bijv. https://ntfy.sh", "prefs_users_dialog_username_label": "Gebruikersnaam, bijv. phil", - "prefs_users_dialog_button_cancel": "Annuleren", - "prefs_users_dialog_button_add": "Toevoegen", - "prefs_users_dialog_button_save": "Bewaren", + "common_cancel": "Annuleren", + "common_add": "Toevoegen", + "common_save": "Bewaren", "prefs_appearance_title": "Weergave", "prefs_appearance_language_title": "Taal", "priority_min": "min", diff --git a/web/public/static/langs/pl.json b/web/public/static/langs/pl.json index 697de556..34789e1f 100644 --- a/web/public/static/langs/pl.json +++ b/web/public/static/langs/pl.json @@ -141,9 +141,9 @@ "prefs_users_delete_button": "Usuń użytkownika", "prefs_users_table_base_url_header": "Adres URL usługi", "prefs_users_dialog_title_add": "Dodaj użytkownika", - "prefs_users_dialog_button_cancel": "Anuluj", - "prefs_users_dialog_button_add": "Dodaj", - "prefs_users_dialog_button_save": "Zapisz", + "common_cancel": "Anuluj", + "common_add": "Dodaj", + "common_save": "Zapisz", "prefs_appearance_title": "Wygląd", "prefs_appearance_language_title": "Język", "error_boundary_title": "Oh nie, ntfy przestało działać", diff --git a/web/public/static/langs/pt.json b/web/public/static/langs/pt.json index a1024caa..7c49e207 100644 --- a/web/public/static/langs/pt.json +++ b/web/public/static/langs/pt.json @@ -108,8 +108,8 @@ "prefs_notifications_delete_after_one_month_description": "As notificações serão eliminadas automaticamente após um mês", "prefs_users_dialog_username_label": "Utilizador, por exemplo: \"filipe\"", "prefs_users_dialog_password_label": "Palavra-passe", - "prefs_users_dialog_button_cancel": "Cancelar", - "prefs_users_dialog_button_add": "Adicionar", + "common_cancel": "Cancelar", + "common_add": "Adicionar", "error_boundary_description": "Obviamente, isto não devia acontecer, lamentamos o sucedido.
Se tiver um minuto, por favor relate isto no GitHub, ou informe-nos através de Discord ou Matrix.", "error_boundary_stack_trace": "Erro (\"stack trace\")", "error_boundary_gathering_info": "A recolher mais informações …", @@ -178,7 +178,7 @@ "prefs_users_dialog_title_add": "Adicionar utilizador", "prefs_users_dialog_title_edit": "Editar utilizador", "prefs_users_dialog_base_url_label": "URL de serviço, por exemplo: https://ntfy.sh", - "prefs_users_dialog_button_save": "Gravar", + "common_save": "Gravar", "prefs_appearance_title": "Aparência", "prefs_appearance_language_title": "Idioma", "priority_min": "mínima", diff --git a/web/public/static/langs/pt_BR.json b/web/public/static/langs/pt_BR.json index 009458ed..79622be3 100644 --- a/web/public/static/langs/pt_BR.json +++ b/web/public/static/langs/pt_BR.json @@ -108,9 +108,9 @@ "prefs_users_dialog_base_url_label": "URL de serviço, exemplo https://ntfy.sh", "prefs_users_dialog_username_label": "Usuário, por exemplo phil", "prefs_users_dialog_password_label": "Senha", - "prefs_users_dialog_button_cancel": "Cancelar", - "prefs_users_dialog_button_add": "Adicionar", - "prefs_users_dialog_button_save": "Salvar", + "common_cancel": "Cancelar", + "common_add": "Adicionar", + "common_save": "Salvar", "prefs_appearance_title": "Aparência", "prefs_appearance_language_title": "LInguagem", "priority_min": "minima", diff --git a/web/public/static/langs/ru.json b/web/public/static/langs/ru.json index 0e1cfea5..c629e52a 100644 --- a/web/public/static/langs/ru.json +++ b/web/public/static/langs/ru.json @@ -135,9 +135,9 @@ "prefs_users_dialog_base_url_label": "URL-адрес службы. Например, https://ntfy.sh", "prefs_users_dialog_username_label": "Имя пользователя. Например, phil", "prefs_users_dialog_password_label": "Пароль", - "prefs_users_dialog_button_cancel": "Отмена", - "prefs_users_dialog_button_add": "Добавить", - "prefs_users_dialog_button_save": "Сохранить", + "common_cancel": "Отмена", + "common_add": "Добавить", + "common_save": "Сохранить", "prefs_appearance_title": "Внешний вид", "prefs_appearance_language_title": "Язык", "priority_min": "минимум", diff --git a/web/public/static/langs/tr.json b/web/public/static/langs/tr.json index 87458e53..704d65d0 100644 --- a/web/public/static/langs/tr.json +++ b/web/public/static/langs/tr.json @@ -126,9 +126,9 @@ "prefs_users_dialog_username_label": "Kullanıcı adı, örn. phil", "prefs_users_table_user_header": "Kullanıcı", "prefs_users_dialog_password_label": "Parola", - "prefs_users_dialog_button_add": "Ekle", - "prefs_users_dialog_button_cancel": "İptal", - "prefs_users_dialog_button_save": "Kaydet", + "common_add": "Ekle", + "common_cancel": "İptal", + "common_save": "Kaydet", "prefs_appearance_title": "Görünüm", "prefs_appearance_language_title": "Dil", "error_boundary_title": "Olamaz, ntfy çöktü", diff --git a/web/public/static/langs/uk.json b/web/public/static/langs/uk.json index 9420b8d5..304bd9df 100644 --- a/web/public/static/langs/uk.json +++ b/web/public/static/langs/uk.json @@ -73,7 +73,7 @@ "prefs_users_title": "Керувати користувачами", "prefs_users_table": "Таблиця користувачів", "prefs_users_edit_button": "Редагувати користувача", - "prefs_users_dialog_button_save": "Зберегти", + "common_save": "Зберегти", "prefs_appearance_title": "Зовнішній вигляд", "priority_default": "за замовчуванням", "priority_high": "високий", @@ -178,8 +178,8 @@ "prefs_users_table_user_header": "Користувач", "prefs_users_dialog_title_add": "Додати користувача", "prefs_users_dialog_username_label": "Ім'я користувача, наприклад phil", - "prefs_users_dialog_button_cancel": "Скасувати", - "prefs_users_dialog_button_add": "Додати", + "common_cancel": "Скасувати", + "common_add": "Додати", "prefs_appearance_language_title": "Мова", "error_boundary_gathering_info": "Зберіть більше інформації…", "priority_min": "мін", diff --git a/web/public/static/langs/zh_Hans.json b/web/public/static/langs/zh_Hans.json index e4bb4810..945c0eb2 100644 --- a/web/public/static/langs/zh_Hans.json +++ b/web/public/static/langs/zh_Hans.json @@ -136,8 +136,8 @@ "prefs_users_dialog_title_edit": "编辑用户", "prefs_users_dialog_username_label": "用户名,例如 phil", "prefs_users_dialog_password_label": "密码", - "prefs_users_dialog_button_cancel": "取消", - "prefs_users_dialog_button_save": "保存", + "common_cancel": "取消", + "common_save": "保存", "prefs_appearance_title": "外观", "prefs_appearance_language_title": "语言", "priority_min": "最低", @@ -179,7 +179,7 @@ "prefs_notifications_delete_after_three_hours": "三小时后", "prefs_users_delete_button": "删除用户", "prefs_users_table_user_header": "用户", - "prefs_users_dialog_button_add": "添加", + "common_add": "添加", "prefs_notifications_delete_after_one_day": "一天后", "error_boundary_description": "这显然不应该发生。对此非常抱歉。
如果您有时间,请在GitHub上报告,或通过DiscordMatrix告诉我们。", "prefs_users_table": "用户表", diff --git a/web/public/static/langs/zh_Hant.json b/web/public/static/langs/zh_Hant.json index 09b9b489..396a8760 100644 --- a/web/public/static/langs/zh_Hant.json +++ b/web/public/static/langs/zh_Hant.json @@ -76,8 +76,8 @@ "prefs_users_add_button": "新增使用者", "prefs_users_dialog_password_label": "密碼", "prefs_users_dialog_title_add": "新增使用者", - "prefs_users_dialog_button_save": "儲存", - "prefs_users_dialog_button_cancel": "取消", + "common_save": "儲存", + "common_cancel": "取消", "error_boundary_title": "歐買尬,ntfy 壞掉了", "notifications_none_for_any_description": "要開始發送通知到一個主題,只需要對主題 URL 發送 HTTP PUT 或者 POST,例如:", "notifications_no_subscriptions_description": "點選 「{{linktext}}」 連結以建立或訂閱主題。完成後,你就可以使用 HTTP PUT 或者 POST 發送通知到這裡了!", diff --git a/web/src/app/AccountApi.js b/web/src/app/AccountApi.js index aacbfbdd..8a78e272 100644 --- a/web/src/app/AccountApi.js +++ b/web/src/app/AccountApi.js @@ -8,7 +8,7 @@ import { accountSubscriptionSingleUrl, accountSubscriptionUrl, accountTokenUrl, - accountUrl, + accountUrl, maybeWithBearerAuth, tiersUrl, withBasicAuth, withBearerAuth @@ -78,7 +78,7 @@ class AccountApi { const url = accountUrl(config.base_url); console.log(`[AccountApi] Fetching user account ${url}`); const response = await fetchOrThrow(url, { - headers: withBearerAuth({}, session.token()) + headers: maybeWithBearerAuth({}, session.token()) // GET /v1/account endpoint can be called by anonymous }); const account = await response.json(); // May throw SyntaxError console.log(`[AccountApi] Account`, account); diff --git a/web/src/app/utils.js b/web/src/app/utils.js index 4c7d111f..c53a0f39 100644 --- a/web/src/app/utils.js +++ b/web/src/app/utils.js @@ -113,6 +113,13 @@ export const maybeWithAuth = (headers, user) => { return headers; } +export const maybeWithBearerAuth = (headers, token) => { + if (token) { + return withBearerAuth(headers, token); + } + return headers; +} + export const withBasicAuth = (headers, username, password) => { headers['Authorization'] = basicAuth(username, password); return headers; diff --git a/web/src/components/AvatarBox.js b/web/src/components/AvatarBox.js index 3d32997e..2278f605 100644 --- a/web/src/components/AvatarBox.js +++ b/web/src/components/AvatarBox.js @@ -1,7 +1,7 @@ import * as React from 'react'; import {Avatar} from "@mui/material"; import Box from "@mui/material/Box"; -import logo from "../img/ntfy2.svg"; +import logo from "../img/ntfy-filled.svg"; const AvatarBox = (props) => { return ( diff --git a/web/src/components/Preferences.js b/web/src/components/Preferences.js index 4240f112..f8af3aee 100644 --- a/web/src/components/Preferences.js +++ b/web/src/components/Preferences.js @@ -412,8 +412,8 @@ const UserDialog = (props) => { /> - - + + ); diff --git a/web/src/components/ReserveDialogs.js b/web/src/components/ReserveDialogs.js index 33f2db35..7a6a044f 100644 --- a/web/src/components/ReserveDialogs.js +++ b/web/src/components/ReserveDialogs.js @@ -76,8 +76,8 @@ export const ReserveAddDialog = (props) => { /> - - + + ); diff --git a/web/src/img/ntfy2.svg b/web/src/img/ntfy-filled.svg similarity index 100% rename from web/src/img/ntfy2.svg rename to web/src/img/ntfy-filled.svg