encrypts integration secrets
This commit is contained in:
@@ -60,6 +60,7 @@
|
||||
></TextField>
|
||||
<TextField
|
||||
label={$_("password")}
|
||||
placeholder={integration?.komoot ? `(${$_("unchanged")})` : ""}
|
||||
name="password"
|
||||
type="password"
|
||||
error={$errors.password}
|
||||
|
||||
@@ -21,14 +21,11 @@
|
||||
let modal: Modal;
|
||||
|
||||
export function openModal() {
|
||||
errors.set({})
|
||||
errors.set({});
|
||||
modal.openModal();
|
||||
}
|
||||
|
||||
const {
|
||||
form,
|
||||
errors,
|
||||
} = createForm({
|
||||
const { form, errors } = createForm({
|
||||
initialValues: {
|
||||
clientId: integration?.strava?.clientId ?? "",
|
||||
clientSecret: integration?.strava?.clientSecret ?? "",
|
||||
@@ -62,7 +59,7 @@
|
||||
></TextField>
|
||||
<TextField
|
||||
label="Client Secret"
|
||||
placeholder="de8b3789bd7116d..."
|
||||
placeholder={integration?.strava ? `(${$_("unchanged")})` : "de8b3789bd7116d..."}
|
||||
name="clientSecret"
|
||||
type="password"
|
||||
error={$errors.clientSecret}
|
||||
|
||||
@@ -147,7 +147,9 @@
|
||||
"include-description": "Beschreibung übernehmen",
|
||||
"integration-description-komoot": "",
|
||||
"integration-description-strava": "",
|
||||
"integration-disabled": "",
|
||||
"integrations": "",
|
||||
"integration-enabled": "",
|
||||
"invalid-date": "Ungültiges Datum",
|
||||
"invalid-username": "Ungültiger Nutzername",
|
||||
"italian": "Italienisch",
|
||||
@@ -289,6 +291,7 @@
|
||||
"trail-not-shared": "Route mit niemandem geteilt",
|
||||
"trail-saved-successfully": "Route gespeichert",
|
||||
"trails-for-you": "Routen für dich",
|
||||
"unchanged": "",
|
||||
"units": "Einheiten",
|
||||
"upload-file": "Datei hochladen",
|
||||
"upload-gpx": "GPX hochladen",
|
||||
|
||||
@@ -147,7 +147,9 @@
|
||||
"include-description": "Include description",
|
||||
"integration-description-komoot": "Syncs your komoot tours with wanderer in regular intervals.",
|
||||
"integration-description-strava": "Syncs your strava routes & activities with wanderer in regular intervals.",
|
||||
"integration-disabled": "integration disabled",
|
||||
"integrations": "Integrations",
|
||||
"integration-enabled": "integration enabled",
|
||||
"invalid-date": "Invalid Date",
|
||||
"invalid-username": "Invalid username",
|
||||
"italian": "Italian",
|
||||
@@ -289,6 +291,7 @@
|
||||
"trail-not-shared": "Not shared with anyone",
|
||||
"trail-saved-successfully": "Trail saved successfully",
|
||||
"trails-for-you": "Trails for you",
|
||||
"unchanged": "unchanged",
|
||||
"units": "Units",
|
||||
"upload-file": "Upload file",
|
||||
"upload-gpx": "Upload GPX",
|
||||
|
||||
@@ -147,7 +147,9 @@
|
||||
"include-description": "Incluir descripción",
|
||||
"integration-description-komoot": "",
|
||||
"integration-description-strava": "",
|
||||
"integration-disabled": "",
|
||||
"integrations": "",
|
||||
"integration-enabled": "",
|
||||
"invalid-date": "Fecha no válida",
|
||||
"invalid-username": "Usuario no válido",
|
||||
"italian": "Italiano",
|
||||
@@ -289,6 +291,7 @@
|
||||
"trail-not-shared": "No compartida con nadie",
|
||||
"trail-saved-successfully": "Ruta guardada con éxito",
|
||||
"trails-for-you": "Rutas para ti",
|
||||
"unchanged": "",
|
||||
"units": "Unidades",
|
||||
"upload-file": "Cargar archivo",
|
||||
"upload-gpx": "Cargar GPX",
|
||||
|
||||
@@ -147,7 +147,9 @@
|
||||
"include-description": "Inclure la description",
|
||||
"integration-description-komoot": "",
|
||||
"integration-description-strava": "",
|
||||
"integration-disabled": "",
|
||||
"integrations": "",
|
||||
"integration-enabled": "",
|
||||
"invalid-date": "Date invalide",
|
||||
"invalid-username": "Nom d'utilisateur invalide",
|
||||
"italian": "Italien",
|
||||
@@ -289,6 +291,7 @@
|
||||
"trail-not-shared": "L'itinéraire n'a pas été partagé",
|
||||
"trail-saved-successfully": "Itinéraire enregistrée",
|
||||
"trails-for-you": "Itinéraire pour vous",
|
||||
"unchanged": "",
|
||||
"units": "Unités",
|
||||
"upload-file": "Importer un fichier",
|
||||
"upload-gpx": "Envoyer un GPX",
|
||||
|
||||
@@ -147,7 +147,9 @@
|
||||
"include-description": "Include description",
|
||||
"integration-description-komoot": "",
|
||||
"integration-description-strava": "",
|
||||
"integration-disabled": "",
|
||||
"integrations": "",
|
||||
"integration-enabled": "",
|
||||
"invalid-date": "Érvénytelen dátum",
|
||||
"invalid-username": "Érvénytelen felhasználó",
|
||||
"italian": "Olasz",
|
||||
@@ -289,6 +291,7 @@
|
||||
"trail-not-shared": "Not shared with anyone",
|
||||
"trail-saved-successfully": "Trail saved successfully",
|
||||
"trails-for-you": "Útvonalak önnek",
|
||||
"unchanged": "",
|
||||
"units": "Mértékegységek",
|
||||
"upload-file": "Fájl feltöltése",
|
||||
"upload-gpx": "GPX feltöltése",
|
||||
|
||||
@@ -147,7 +147,9 @@
|
||||
"include-description": "Adotta descrizione",
|
||||
"integration-description-komoot": "",
|
||||
"integration-description-strava": "",
|
||||
"integration-disabled": "",
|
||||
"integrations": "",
|
||||
"integration-enabled": "",
|
||||
"invalid-date": "Data non valida",
|
||||
"invalid-username": "Nome utente non valido",
|
||||
"italian": "Italiano",
|
||||
@@ -289,6 +291,7 @@
|
||||
"trail-not-shared": "Percorso non condiviso con nessuno",
|
||||
"trail-saved-successfully": "Percorso salvato con successo",
|
||||
"trails-for-you": "Percorsi per te",
|
||||
"unchanged": "",
|
||||
"units": "Unità",
|
||||
"upload-file": "Carica file",
|
||||
"upload-gpx": "Carica file GPX",
|
||||
|
||||
@@ -147,7 +147,9 @@
|
||||
"include-description": "Inclusief beschrijving",
|
||||
"integration-description-komoot": "",
|
||||
"integration-description-strava": "",
|
||||
"integration-disabled": "",
|
||||
"integrations": "",
|
||||
"integration-enabled": "",
|
||||
"invalid-date": "Ongeldige datum",
|
||||
"invalid-username": "Ongeldige gebruikersnaam",
|
||||
"italian": "Italiaans",
|
||||
@@ -289,6 +291,7 @@
|
||||
"trail-not-shared": "Not shared with anyone",
|
||||
"trail-saved-successfully": "Trail saved successfully",
|
||||
"trails-for-you": "Wandelroutes voor jou",
|
||||
"unchanged": "",
|
||||
"units": "Eenheden",
|
||||
"upload-file": "Bestand uploaden",
|
||||
"upload-gpx": "GPX-bestand uploaden",
|
||||
|
||||
@@ -147,7 +147,9 @@
|
||||
"include-description": "Dołącz opis",
|
||||
"integration-description-komoot": "",
|
||||
"integration-description-strava": "",
|
||||
"integration-disabled": "",
|
||||
"integrations": "",
|
||||
"integration-enabled": "",
|
||||
"invalid-date": "Nieprawidłowa data",
|
||||
"invalid-username": "Błędna nazwa użytkownika",
|
||||
"italian": "Włoski",
|
||||
@@ -289,6 +291,7 @@
|
||||
"trail-not-shared": "Szlak nie udostępniony",
|
||||
"trail-saved-successfully": "Szlak pomyślnie zapisany",
|
||||
"trails-for-you": "Szlaki dla ciebie",
|
||||
"unchanged": "",
|
||||
"units": "Jednostki",
|
||||
"upload-file": "Przesyłanie pliku",
|
||||
"upload-gpx": "Importuj GPX",
|
||||
|
||||
@@ -147,7 +147,9 @@
|
||||
"include-description": "Incluir descrição",
|
||||
"integration-description-komoot": "",
|
||||
"integration-description-strava": "",
|
||||
"integration-disabled": "",
|
||||
"integrations": "",
|
||||
"integration-enabled": "",
|
||||
"invalid-date": "Data inválida",
|
||||
"invalid-username": "Nome de usuário inválido",
|
||||
"italian": "Italiano",
|
||||
@@ -289,6 +291,7 @@
|
||||
"trail-not-shared": "Não partilhado com ninguém",
|
||||
"trail-saved-successfully": "Percurso gravado com sucesso",
|
||||
"trails-for-you": "Trilhos para si",
|
||||
"unchanged": "",
|
||||
"units": "Unidades",
|
||||
"upload-file": "Subir arquivo",
|
||||
"upload-gpx": "Carregar GPX",
|
||||
|
||||
@@ -147,7 +147,9 @@
|
||||
"include-description": "包含描述",
|
||||
"integration-description-komoot": "",
|
||||
"integration-description-strava": "",
|
||||
"integration-disabled": "",
|
||||
"integrations": "",
|
||||
"integration-enabled": "",
|
||||
"invalid-date": "无效日期",
|
||||
"invalid-username": "无效用户名",
|
||||
"italian": "意大利语",
|
||||
@@ -289,6 +291,7 @@
|
||||
"trail-not-shared": "未与任何人分享",
|
||||
"trail-saved-successfully": "路线保存成功",
|
||||
"trails-for-you": "推荐路线",
|
||||
"unchanged": "",
|
||||
"units": "单位",
|
||||
"upload-file": "上传文件",
|
||||
"upload-gpx": "上传 GPX",
|
||||
|
||||
@@ -3,12 +3,9 @@ import type { Integration } from "../integration";
|
||||
|
||||
const StravaSchema = z.object({
|
||||
clientId: z.number({ coerce: true }).int().positive(),
|
||||
clientSecret: z.string().length(40),
|
||||
clientSecret: z.string().length(40).optional().or(z.literal('')),
|
||||
routes: z.boolean(),
|
||||
activities: z.boolean(),
|
||||
accessToken: z.string().length(40).optional(),
|
||||
refreshToken: z.string().length(40).optional(),
|
||||
expiresAt: z.number().int().positive().optional(),
|
||||
active: z.boolean()
|
||||
})
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ export interface BaseIntegration {
|
||||
|
||||
export interface StravaIntegration extends BaseIntegration {
|
||||
clientId: string | number;
|
||||
clientSecret: string;
|
||||
clientSecret?: string;
|
||||
routes: boolean;
|
||||
activities: boolean;
|
||||
accessToken?: string;
|
||||
|
||||
Reference in New Issue
Block a user