18 lines
443 B
JavaScript
18 lines
443 B
JavaScript
import PocketBase from './vendor/pocketbase.es.js';
|
|
|
|
/**
|
|
* Database
|
|
*/
|
|
export const database = new PocketBase('http://localhost:8090');
|
|
|
|
window.db = database;
|
|
|
|
/**
|
|
* Controleer of iemand ingelogd is. Zo niet, stuur iemand naar inloggen.html
|
|
*/
|
|
export function alleenIngelogd() {
|
|
// Als iemand niet ingelogd is, stuur iemand naar inloggen.js
|
|
if (!database.authStore.isValid) {
|
|
window.location.href = 'inloggen.html';
|
|
}
|
|
} |