new routes
This commit is contained in:
@@ -6,7 +6,6 @@ import { userDatesFromRFC3339, refreshCookie } from '$lib/utils/helpers';
|
||||
export async function load({ cookies, fetch, locals }) {
|
||||
const jwt = cookies.get('jwt');
|
||||
try {
|
||||
// Fetch user data, subscriptions, and licence categories in parallel
|
||||
const response = await fetch(`${BASE_API_URI}/backend/users/all`, {
|
||||
credentials: 'include',
|
||||
headers: {
|
||||
@@ -16,7 +15,7 @@ export async function load({ cookies, fetch, locals }) {
|
||||
if (!response.ok) {
|
||||
// Clear the invalid JWT cookie
|
||||
cookies.delete('jwt', { path: '/' });
|
||||
throw redirect(302, '/auth/login?next=/');
|
||||
throw redirect(302, '/auth/login?next=admin/users/');
|
||||
}
|
||||
|
||||
const data = await response.json();
|
||||
@@ -43,6 +42,6 @@ export async function load({ cookies, fetch, locals }) {
|
||||
// In case of any error, clear the JWT cookie
|
||||
cookies.delete('jwt', { path: '/' });
|
||||
|
||||
throw redirect(302, '/auth/login?next=/');
|
||||
throw redirect(302, '/auth/login?next=admin/users/');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user