Connect auth to backend and persist theme preference
This commit is contained in:
21
webui/src/app/components/ClientLayoutEffect.js
Normal file
21
webui/src/app/components/ClientLayoutEffect.js
Normal file
@@ -0,0 +1,21 @@
|
||||
'use client';
|
||||
|
||||
import { useEffect } from 'react';
|
||||
import axios from 'axios';
|
||||
|
||||
export default function ClientLayoutEffect() {
|
||||
useEffect(() => {
|
||||
async function fetchData() {
|
||||
try {
|
||||
const res = await axios.get('/token');
|
||||
console.log('Token response:', res.data);
|
||||
} catch (error) {
|
||||
console.error('Token fetch error:', error);
|
||||
}
|
||||
}
|
||||
|
||||
fetchData().then(r => console.log("Ok"));
|
||||
}, []);
|
||||
|
||||
return null;
|
||||
}
|
||||
Reference in New Issue
Block a user