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
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Built with Electron + React, it wraps the ThoughtSpot Visual Embed SDK to delive
The easiest way to get started is to download the latest release directly — no Node.js or build tools needed.

1. Go to the [Releases](https://github.com/thoughtspot/spotter-desktop/releases) page
2. Download the latest `Spotter-<version>.dmg`
2. Download the latest `Spotter-<version>-arm64.dmg` for Apple Silicon, or `Spotter-<version>.dmg` for an Intel Mac
3. Open the `.dmg`, drag **Spotter** to your Applications folder
4. Launch Spotter from Applications or Spotlight

Expand Down Expand Up @@ -66,7 +66,8 @@ npm run lint
npm run pack
```

Outputs a signed `.dmg` and `.zip` in the `dist/` folder.
Outputs a signed `.dmg` and `.zip` for both Apple Silicon (`-arm64`) and Intel in
the `dist/` folder. Auto-update picks the build matching the running Mac.

### Code Signing & Notarization

Expand Down
30 changes: 8 additions & 22 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 10 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,14 @@
"mac": {
"category": "public.app-category.business",
"target": [
"dmg",
"zip"
{
"target": "dmg",
"arch": ["arm64", "x64"]
},
{
"target": "zip",
"arch": ["arm64", "x64"]
}
],
"icon": "assets/icon.icns",
"hardenedRuntime": true,
Expand Down Expand Up @@ -48,20 +54,19 @@
"@babel/preset-env": "^7.24.0",
"@babel/preset-react": "^7.23.0",
"@fontsource/inter": "^5.2.8",
"@thoughtspot/visual-embed-sdk": "^1.52.0",
"@thoughtspot/visual-embed-sdk": "^1.53.1",
"app-builder-bin": "^4.2.0",
"babel-loader": "^9.1.3",
"css-loader": "^6.10.0",
"dotenv": "^17.4.2",
"electron": "^44.4.1",
"electron": "^44.9.0",
"electron-builder": "^26.15.3",
"eslint": "^9.39.5",
"eslint-plugin-react": "^7.37.5",
"globals": "^17.11.0",
"html-webpack-plugin": "^5.6.0",
"iconv-corefoundation": "^1.1.7",
"mixpanel-browser": "^2.82.0",
"playwright-core": "^1.60.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"style-loader": "^3.3.4",
Expand Down
13 changes: 12 additions & 1 deletion src/main/auth-loading.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<!-- Shown in the auth window while the identity provider is contacted. Kept
self-contained — no fonts, images or scripts from the network — so it
paints instantly and works before any connection is established. Tokens
mirror src/renderer/styles.css so the wait looks like part of the app. -->
mirror src/renderer/styles.css, dark set included, so the wait looks like part of the app. -->
<title>Signing in…</title>
<style>
:root {
Expand All @@ -17,6 +17,17 @@
--accent-soft: #93b4f5;
--track: rgba(15, 23, 42, 0.07);
}
@media (prefers-color-scheme: dark) {
:root {
--bg: #1f2024;
--text-strong: #f3f4f6;
--text-muted: rgba(243, 244, 246, 0.65);
--text-faint: rgba(243, 244, 246, 0.4);
--accent: #3b82f6;
--accent-soft: #2a4a80;
--track: rgba(243, 244, 246, 0.1);
}
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
Expand Down
32 changes: 32 additions & 0 deletions src/main/auth.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
const { session } = require('electron');
const config = require('./config');
const { isValidHttpsUrl } = require('./urls');

// The endpoint the SDK and ThoughtSpot itself use to ask "is this session still
// good": 200 while it is, 401 once it has expired or been signed out.
const IS_ACTIVE_PATH = '/callosum/v1/session/isactive';

// The persisted loggedIn flag only records that a sign-in once completed. The
// SDK cannot be asked instead: with AuthType.None it reports success without
// checking anything. So the session is checked here, on the same cookie jar the
// embed uses, before the app trusts the flag.
//
// Resolves true or false when the cluster answered, and null when it could not
// be reached. Offline is not signed out: treating it as such would send someone
// back to the sign-in screen every time they open the app on a train.
async function isSessionActive() {
const host = config.read().hostUrl;
if (!isValidHttpsUrl(host)) return false;
try {
const res = await session.defaultSession.fetch(`${host}${IS_ACTIVE_PATH}`, {
credentials: 'include',
});
if (res.ok) return true;
if (res.status === 401 || res.status === 403) return false;
return null;
} catch {
return null;
}
}

module.exports = { isSessionActive };
Loading
Loading