Initial commit
This commit is contained in:
18
www/js/index.js
Normal file
18
www/js/index.js
Normal file
@@ -0,0 +1,18 @@
|
||||
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';
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user