Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions js/wearable-adapters.js
Original file line number Diff line number Diff line change
Expand Up @@ -306,12 +306,10 @@ export const ADAPTERS = [
// character-for-character.
clientId: '23VBN8',
redirectUris: [
'https://app.getbased.health/app',
'https://app.getbased.health/',
'https://app.getbased.health',
'http://localhost:8000/app',
'https://getbased.health/app',
'https://beta.getbased.health/',
'https://beta.getbased.health/app',
'http://localhost:8000/app',
],
scopes: ['profile', 'activity', 'heartrate', 'sleep', 'oxygen_saturation', 'respiratory_rate', 'temperature', 'weight'],
pkce: true,
Expand Down
11 changes: 7 additions & 4 deletions tests/test-wearables.js
Original file line number Diff line number Diff line change
Expand Up @@ -1009,10 +1009,13 @@ assert('Fitbit scopes include temperature + weight (for skin Δ + scale readings
assert('Fitbit adapter scope list matches DEFAULT_FITBIT_SCOPES (no drift)',
JSON.stringify([...fitbitReg.oauth.scopes].sort()) ===
JSON.stringify([...fitbitAuth.DEFAULT_FITBIT_SCOPES].sort()));
assert('Fitbit hosted /app route is registered before origin fallback',
fitbitReg.oauth.redirectUris.includes('https://app.getbased.health/app'));
assert('Fitbit redirect picker keeps hosted /app instead of falling back to origin root',
fitbitAuth.pickRedirectUri(fitbitReg.oauth.redirectUris, { origin: 'https://app.getbased.health', pathname: '/app' }) === 'https://app.getbased.health/app');
assert('Fitbit hosted redirect matches dev-console value exactly',
fitbitReg.oauth.redirectUris.includes('https://app.getbased.health'));
assert('Fitbit redirect picker uses exact registered live-host URI without adding slash or /app',
fitbitAuth.pickRedirectUri(fitbitReg.oauth.redirectUris, { origin: 'https://app.getbased.health', pathname: '/app' }) === 'https://app.getbased.health');
assert('Fitbit redirect registry does not include unregistered hosted /app or slash variants',
!fitbitReg.oauth.redirectUris.includes('https://app.getbased.health/app') &&
!fitbitReg.oauth.redirectUris.includes('https://app.getbased.health/'));

const fbUrl = await fitbitAuth.buildAuthorizeUrl({
clientId: 'fb-test-client', redirectUri: 'http://localhost:8000/app',
Expand Down
2 changes: 1 addition & 1 deletion version.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
// Classic script (not ES module) so it works in both browser and service worker.
// Browser: <script src="version.js"> sets window.APP_VERSION
// Service worker: importScripts('/version.js') sets self.APP_VERSION
self.APP_VERSION = '1.8.343';
self.APP_VERSION = '1.8.344';