fix: logout loop — authUrl was empty in user-widget script due to Astro 5 define:vars behaviour; read from window.__bincioAuthUrl instead
This commit is contained in:
@@ -101,6 +101,7 @@ try {
|
||||
{instancePrivate && !isPublicPage && (
|
||||
<style is:inline>[data-auth-pending]{visibility:hidden}</style>
|
||||
<script is:inline define:vars={{ authUrl }}>
|
||||
window.__bincioAuthUrl = authUrl;
|
||||
fetch('/api/me', { credentials: 'include' })
|
||||
.then(r => {
|
||||
if (r.status === 401 || r.status === 404) {
|
||||
@@ -590,7 +591,8 @@ try {
|
||||
|
||||
<!-- User widget: only needed for multi-user (single-user nav links are static) -->
|
||||
{!singleHandle && (
|
||||
<script define:vars={{ baseUrl, authUrl }}>
|
||||
<script define:vars={{ baseUrl }}>
|
||||
const authUrl: string = (window as any).__bincioAuthUrl ?? '';
|
||||
(async () => {
|
||||
try {
|
||||
const r = await fetch('/api/me', { credentials: 'include' });
|
||||
@@ -732,6 +734,7 @@ try {
|
||||
|
||||
{editEnabled && (
|
||||
<script define:vars={{ editUrl, baseUrl }}>
|
||||
const authUrl: string = (window as any).__bincioAuthUrl ?? '';
|
||||
const modal = document.getElementById('upload-modal');
|
||||
const openBtn = document.getElementById('upload-btn');
|
||||
const closeBtn = document.getElementById('upload-close');
|
||||
|
||||
Reference in New Issue
Block a user