fix: photos now display in History with token auth
Problem: Photo endpoint requires auth header, but <img src> can't send headers. Solution: - Backend: Added require_auth_flexible() that accepts token via header OR query param - Backend: Photo endpoint uses flexible auth - Frontend: photoUrl() now appends ?token=xxx to URL Photos in History/Verlauf now display correctly. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
b6f8b11685
commit
e10e9d7eb9
2 files changed
+17
-4
No files matched your search
@@ -68,7 +68,10 @@ export const api = {
|
||||
return fetch(`${BASE}/photos`,{method:'POST',body:fd,headers:hdrs()}).then(r=>r.json())
|
||||
},
|
||||
listPhotos: () => req('/photos'),
|
||||
photoUrl: (pid) => `${BASE}/photos/${pid}`,
|
||||
photoUrl: (pid) => {
|
||||
const token = getToken()
|
||||
return `${BASE}/photos/${pid}${token ? `?token=${token}` : ''}`
|
||||
},
|
||||
|
||||
// Nutrition
|
||||
importCsv: async(file)=>{
|
||||
|
||||
Reference in new issue
Block a user