// Credentials schema per provider name. Defines the fields to collect and how to label them. var PROVIDER_CREDENTIAL_SCHEMAS = { // todo Figure out SOTA authentication // see e.g. https://github.com/ham2k/app-polo/blob/main/src/extensions/activities/sota/SOTAAccount.jsx // https://github.com/ham2k/app-polo/blob/main/src/store/apis/apiSOTA/apiSOTA.js // Refresh token? Way to show user that they need to log in again because cached credentials aren't valid? "SOTA": [ { key: "access_token", label: "SOTA Access Token", help: "" }, { key: "id_token", label: "SOTA ID Token", help: "TODO SOTA authentication to provide this..." } ], "ParksNPeaks": [ { key: "user_id", label: "Parks N Peaks User ID", help: "" }, { key: "api_key", label: "Parks N Peaks API Key", help: "Get your API key from your Parks N Peaks account." } ], "ZLOTA": [ { key: "user_id", label: "ZLOTA User ID", help: "" }, { key: "api_key", label: "ZLOTA User PIN", help: "Get your PIN from your ZLOTA account." } ] }; // Load server options. Once a successful callback is made from this, we can populate the choice boxes in the form and load // any saved values from local storage. function loadOptions() { $.getJSON('/api/v1/options', function(jsonData) { // Store options options = jsonData; // Populate modes drop-down $.each(options["modes"], function (i, m) { $('#mode').append($('