fix: route polyline visibility + login URL

B1: Add ResizeObserver to MapView.jsx to handle layout settling.
The map canvas had 0 height at init because layout hadnt settled
when the useEffect fired. ResizeObserver calls map.resize() on
any container size change.

B11: Use native outpost start URL for login initiation:
/outpost.goauthentik.io/start?rd=%2F
This properly triggers auth flow and redirects to / after login.
Removed the Caddy /login handler that wasnt redirecting correctly.
This commit is contained in:
Matt 2026-04-27 03:51:34 +00:00
commit fe77c6d459
5 changed files with 11 additions and 4 deletions

View file

@ -36,7 +36,7 @@ export default function ContactList() {
Sign in to save and sync your contacts Sign in to save and sync your contacts
</p> </p>
<button <button
onClick={() => { window.location.href = '/login' }} onClick={() => { window.location.href = '/outpost.goauthentik.io/start?rd=%2F' }}
className="inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-medium" className="inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-medium"
style={{ background: 'var(--accent)', color: 'var(--text-inverse)' }} style={{ background: 'var(--accent)', color: 'var(--text-inverse)' }}
> >

View file

@ -1046,7 +1046,14 @@ const MapView = forwardRef(function MapView(_, ref) {
mapInstance.current = map mapInstance.current = map
// ResizeObserver to handle layout settling, panel changes, window resize
const ro = new ResizeObserver(() => {
map.resize()
})
ro.observe(mapRef.current)
return () => { return () => {
ro.disconnect()
if (watchIdRef.current != null) navigator.geolocation.clearWatch(watchIdRef.current) if (watchIdRef.current != null) navigator.geolocation.clearWatch(watchIdRef.current)
if (gpsMarkerRef.current) gpsMarkerRef.current.remove() if (gpsMarkerRef.current) gpsMarkerRef.current.remove()
maplibregl.removeProtocol('pmtiles') maplibregl.removeProtocol('pmtiles')

View file

@ -61,7 +61,7 @@ export default function Panel({ onManeuverClick }) {
} }
// Auth handlers // Auth handlers
const handleLogin = () => { window.location.href = '/login' } const handleLogin = () => { window.location.href = '/outpost.goauthentik.io/start?rd=%2F' }
const handleLogout = () => { window.location.href = '/outpost.goauthentik.io/sign_out' } const handleLogout = () => { window.location.href = '/outpost.goauthentik.io/sign_out' }
// Optimize stops // Optimize stops

View file

@ -432,7 +432,7 @@ export function PlaceCard({ place, variant = "preview", expanded = true, onToggl
{auth.authenticated ? ( {auth.authenticated ? (
<button onClick={handleSave} className="p-2 rounded-lg" style={{ background: savedContact ? "var(--accent-muted)" : "var(--tan-muted)", color: savedContact ? "var(--accent)" : "var(--tan)", border: "1px solid var(--border)" }} aria-label={savedContact ? "Edit saved contact" : "Save place"}><Bookmark size={14} fill={savedContact ? "currentColor" : "none"} /></button> <button onClick={handleSave} className="p-2 rounded-lg" style={{ background: savedContact ? "var(--accent-muted)" : "var(--tan-muted)", color: savedContact ? "var(--accent)" : "var(--tan)", border: "1px solid var(--border)" }} aria-label={savedContact ? "Edit saved contact" : "Save place"}><Bookmark size={14} fill={savedContact ? "currentColor" : "none"} /></button>
) : ( ) : (
<button onClick={() => { window.location.href = "/login" }} className="flex items-center gap-1 px-2 py-1.5 rounded-lg text-xs" style={{ background: "var(--accent-muted)", color: "var(--accent)", border: "1px solid var(--border)" }} title="Log in to save places"><LogIn size={12} /><span>Save</span></button> <button onClick={() => { window.location.href = "/outpost.goauthentik.io/start?rd=%2F" }} className="flex items-center gap-1 px-2 py-1.5 rounded-lg text-xs" style={{ background: "var(--accent-muted)", color: "var(--accent)", border: "1px solid var(--border)" }} title="Log in to save places"><LogIn size={12} /><span>Save</span></button>
)} )}
<div className="relative"> <div className="relative">
<button onClick={() => setCopyOpen((v) => !v)} className="p-2 rounded-lg flex items-center gap-0.5" style={{ background: "var(--tan-muted)", color: "var(--tan)", border: "1px solid var(--border)" }} aria-label="Copy"><Copy size={14} /><ChevronDown size={10} /></button> <button onClick={() => setCopyOpen((v) => !v)} className="p-2 rounded-lg flex items-center gap-0.5" style={{ background: "var(--tan-muted)", color: "var(--tan)", border: "1px solid var(--border)" }} aria-label="Copy"><Copy size={14} /><ChevronDown size={10} /></button>

View file

@ -758,7 +758,7 @@ export default function PlaceDetail() {
</button> </button>
) : ( ) : (
<button <button
onClick={() => { window.location.href = '/login' }} onClick={() => { window.location.href = '/outpost.goauthentik.io/start?rd=%2F' }}
className="flex items-center gap-1 px-2 py-1.5 rounded-lg text-xs" className="flex items-center gap-1 px-2 py-1.5 rounded-lg text-xs"
style={{ background: 'var(--accent-muted)', color: 'var(--accent)', border: '1px solid var(--border)' }} style={{ background: 'var(--accent-muted)', color: 'var(--accent)', border: '1px solid var(--border)' }}
title="Log in to save places" title="Log in to save places"