tonesto7 / fordpass-scriptable

FordPass Widget for Scriptable
GNU General Public License v3.0
166 stars 27 forks source link

Issue retrieving authentication token #135

Open ryanmalani opened 1 year ago

ryanmalani commented 1 year ago

I believe that the way in which the authentication token is being requested in the FPW_FordAPIs file is outdated. Below are the changes made in a similar NPM module to update to the newest way of authenticating users via the API. I came to this conclusion while debugging the script through scriptable, the checkAuth method was returning 'null' for the Token value.

ffpass-module auth implementation update commit details

2023-04-01 13:36:01: All (9) Required Modules Found! 2023-04-01 13:36:01: 2023-04-01 13:36:01: Widget RUN () 2023-04-01 13:36:01: Required Prefs Missing: fpToken, fpCountry, fpLanguage, fpTz, fpPress ureUnits, fpDistanceUnits 2023-04-01 13:36:01: Script Version: 2022.10.15.1 2023-04-01 13:36:01: Update Available: false 2023-04-01 13:36:01: Latest Version: 2022.10.15.1 2023-04-01 13:36:03: (Required Prefs Menu) Done was pressed 2023-04-01 13:36:03: (prepWidget) Prefs Menu Prompt Result: true 2023-04-01 13:36:03: chechAuth (prepWidget) 2023-04-01 13:36:03: checkAuth | Token: null 2023-04-01 13:36:03: checkAuth| ExpiresAt: null 2023-04-01 13:36:03: checkAuth | Expired: false 2023-04-01 13:36:03: No Token found... Forcing Token Fetch... 2023-04-01 13:36:03: Fetching Token. 2023-04-01 13:36:03: prepWidget ) Error: Error: The data couldn't be read because it isn't in the correct format.

@tonesto7 Really loved the functionality of this widget and would love to have it back. I'm going to go through the source and try my hand at fixing the issue and opening a pull request, but happy to collaborate on it if you have the time and are interested in revisiting this!