added missing ! to hasprivilige lol
This commit is contained in:
@@ -3,8 +3,6 @@ import { refreshCookie, userDatesFromRFC3339 } from '$lib/utils/helpers';
|
||||
|
||||
/** @type {import('@sveltejs/kit').Handle} */
|
||||
export async function handle({ event, resolve }) {
|
||||
console.log('BaseApiUrl:', `${BASE_API_URI}`);
|
||||
console.log('System operates in ', import.meta.env.MODE);
|
||||
if (event.locals.user) {
|
||||
// if there is already a user in session load page as normal
|
||||
console.log('user is logged in');
|
||||
|
||||
@@ -20,10 +20,6 @@ export async function load({ cookies, fetch, locals }) {
|
||||
}
|
||||
|
||||
const data = await response.json();
|
||||
// Check if the server sent a new token
|
||||
const newToken = response.headers.get('Set-Cookie');
|
||||
refreshCookie(newToken, cookies);
|
||||
|
||||
/** @type {App.Locals['users']}*/
|
||||
const users = data.users;
|
||||
|
||||
@@ -32,6 +28,11 @@ export async function load({ cookies, fetch, locals }) {
|
||||
});
|
||||
|
||||
locals.users = users;
|
||||
|
||||
// Check if the server sent a new token
|
||||
const newToken = response.headers.get('Set-Cookie');
|
||||
refreshCookie(newToken, cookies);
|
||||
|
||||
return {
|
||||
subscriptions: locals.subscriptions,
|
||||
licence_categories: locals.licence_categories,
|
||||
|
||||
Reference in New Issue
Block a user