mirror of
https://github.com/zvx-echo6/navi.git
synced 2026-05-20 14:44:51 +02:00
fix: use /login endpoint for auth initiation instead of /api/auth/whoami
The /api/auth/whoami endpoint returns JSON after auth, leaving users on a raw JSON page. The new /login endpoint triggers forward_auth and redirects to / after successful auth.
This commit is contained in:
parent
bc6296415c
commit
77340a9fbc
4 changed files with 4 additions and 4 deletions
|
|
@ -36,7 +36,7 @@ export default function ContactList() {
|
|||
Sign in to save and sync your contacts
|
||||
</p>
|
||||
<button
|
||||
onClick={() => { window.location.href = '/api/auth/whoami' }}
|
||||
onClick={() => { window.location.href = '/login' }}
|
||||
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)' }}
|
||||
>
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ export default function Panel({ onManeuverClick }) {
|
|||
}
|
||||
|
||||
// Auth handlers
|
||||
const handleLogin = () => { window.location.href = '/api/auth/whoami' }
|
||||
const handleLogin = () => { window.location.href = '/login' }
|
||||
const handleLogout = () => { window.location.href = '/outpost.goauthentik.io/sign_out' }
|
||||
|
||||
// Optimize stops
|
||||
|
|
|
|||
|
|
@ -432,7 +432,7 @@ export function PlaceCard({ place, variant = "preview", expanded = true, onToggl
|
|||
{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={() => { window.location.href = "/api/auth/whoami" }} 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 = "/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>
|
||||
)}
|
||||
<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>
|
||||
|
|
|
|||
|
|
@ -758,7 +758,7 @@ export default function PlaceDetail() {
|
|||
</button>
|
||||
) : (
|
||||
<button
|
||||
onClick={() => { window.location.href = '/api/auth/whoami' }}
|
||||
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"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue