import { API_URL } from '$lib/APIurl.js';
import { cal } from '$lib/calendarStore.js';
import axios from 'axios';
- import { currentUser } from '$lib/helpers.js';
$effect(() => {
if ($cal.currentMonth || $cal.currentYear) {
return;
}
- if (!$currentUser) {
- console.log('User not logged in, skipping loadMarkedDays');
- return;
- }
-
if (isLoadingMarkedDays) {
return;
}
import { page } from '$app/state';
import { API_URL } from '$lib/APIurl.js';
import trianglify from 'trianglify';
- import { alwaysShowSidenav, currentUser } from '$lib/helpers.js';
+ import { alwaysShowSidenav } from '$lib/helpers.js';
let { children } = $props();
let inDuration = 150;
.get(API_URL + '/users/logout')
.then((response) => {
localStorage.removeItem('user');
- $currentUser = null;
goto(`/login?error=${error.response.status}`);
})
.catch((error) => {
import axios from 'axios';
import { goto } from '$app/navigation';
import { API_URL } from '$lib/APIurl.js';
- import { currentUser } from '$lib/helpers';
let show_login_failed = $state(false);
let show_login_warning_empty_fields = $state(false);
axios
.post(API_URL + '/users/login', { username, password })
.then((response) => {
- $currentUser = response.data.username;
-
if (response.data.migration_started) {
is_migrating = true;