Skip to content

Auth Flow Refinements, Startup Fixes, and Integrations#196

Merged
chvvkumar merged 13 commits intodevfrom
snd
Apr 19, 2026
Merged

Auth Flow Refinements, Startup Fixes, and Integrations#196
chvvkumar merged 13 commits intodevfrom
snd

Conversation

@chvvkumar
Copy link
Copy Markdown
Owner

@chvvkumar chvvkumar commented Apr 19, 2026

Summary
This pull request stabilizes authentication flows, resolves startup loading hangs, and introduces coordinate forwarding to NINA and Stellarium directly from session cards.

Changes

  • Fixed startup loading hangs by bypassing fetchJson for initial authentication and addressing server-ready transitions.
  • Resolved stale cache and gate settings fetch during authentication.
  • Simplified onServerReady to reuse initAuth and added a 15-second failsafe.
  • Replaced hard window.location redirects with an auth:expired event.
  • Added NINA and Stellarium coordinate forwarding from session cards.
  • Fixed Stellarium focus by checking response bodies and trying catalog names first.
  • Right-justified rig selector pills in session and target metrics charts.
  • Moved action buttons to a right-justified row above thumbnails and inlined them on the headline stats row.
  • Dropped NINA/Stellarium prefixes from coordinate send buttons.
  • Fixed NINA instances help text.

Impact

  • Authentication System: Updates to core authentication provider logic and client API request handling.
  • Startup Process: Modifications to frontend application initialization to prevent loading hangs.
  • Integrations: New backend API endpoints and frontend components for NINA and Stellarium coordinate forwarding.
  • User Interface: Layout and styling adjustments to session cards, metrics charts, and settings pages.
  • Backend API: Introduction of new integration endpoints and schema updates.
  • Deployment: Nginx configuration updated.

Configurable instances managed from Settings (AstroBin & NINA tab).
Backend proxies requests to NINA framing API and Stellarium remote
control. Stellarium uses name-first lookup with RA/Dec fallback.
Stellarium returns 200 with body "false" when name lookup fails.
Now checks the response text instead of just HTTP status. Also
extracts the catalog designation (e.g. NGC 1499) from compound
names like "NGC 1499 - California Nebula" and tries that first.
onServerReady() called refreshUser() without a timeout, so if the
backend was slow to respond after the health check passed the app
stayed on "Loading..." forever. Added a 5-second timeout matching
initAuth(). Also suppress the hard window.location redirect during
auth initialization to avoid racing with the SolidJS router.
Replace refreshUser()/fetchJson in initAuth and onServerReady with a
direct probeAuth() that uses raw fetch calls. This avoids the shared
refreshPromise, the window.location hard redirect, and any interaction
with the parallel settings/custom-columns resource fetches that also
go through fetchJson's 401 handler. Reverts the suppressAuthRedirect
flag from client.ts since it is no longer needed.
fetchJson's 401 handler was firing window.location.href = "/login"
which caused a full page reload that disrupted the SolidJS app during
initialization. Replace with a CustomEvent that AuthProvider listens
to, clearing the user signal so ProtectedRoute handles the redirect
via client-side navigation instead.
onServerReady now just calls initAuth() instead of duplicating the
probeAuth logic. If the server isn't actually ready yet, initAuth
will cycle back to the startup screen. Added a 15-second failsafe
timer that forces loading=false if auth never completes, preventing
the app from staying stuck on "Loading..." indefinitely.
Add Cache-Control: no-store to index.html so the browser always
fetches a fresh copy after rebuilds, preventing stale JS bundles.

Gate the settings and custom-columns resources on auth state so they
only fire after the user is authenticated. Previously the module-level
createResource in settings.ts fired at import time before auth
resolved, hitting 502 during startup and throwing unhandled errors
that could break the SolidJS reactive system.
@github-actions github-actions bot changed the title Snd Auth Flow Refinements, Startup Fixes, and Integrations Apr 19, 2026
@chvvkumar chvvkumar merged commit a47dada into dev Apr 19, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant