Initial migration to new session based auth system with AllAuth

This commit is contained in:
Sean Morley
2024-11-29 14:41:13 -05:00
parent 7defdac3a8
commit 9bc20be70e
24 changed files with 313 additions and 773 deletions

View File

@@ -9,11 +9,9 @@ export const load = (async (event) => {
if (!event.locals.user) {
return redirect(302, '/login');
} else {
const res = await fetch(`${endpoint}/api/countries/`, {
const res = await event.fetch(`${endpoint}/api/countries/`, {
method: 'GET',
headers: {
Cookie: `${event.cookies.get('auth')}`
}
credentials: 'include'
});
if (!res.ok) {
console.error('Failed to fetch countries');