Refactor login and auth

This commit is contained in:
2023-11-13 21:37:53 -05:00
parent ab8e50991e
commit 5ec697b94a
5 changed files with 35 additions and 41 deletions

View File

@@ -1,5 +1,6 @@
import { boot } from 'quasar/wrappers';
import { Client, Account, ID } from 'appwrite';
import { Client, Account, Databases, ID } from 'appwrite';
import { useAuthStore } from 'src/stores/auth';
const client = new Client();
@@ -8,15 +9,14 @@ client
.setProject('653ef6f76baf06d68034');
const account = new Account(client);
const databases = new Databases(client);
// TODO: Auto-logout on session deletion / expiry
// account.get().then(
// client.subscribe('account', (response) => {
// console.log(response);
// })
// );
export default boot(({ app, urlPath, router }) => {
// Initialize store
const authStore = useAuthStore();
authStore.init().then(() => {
authStore.currentUser && router.push('/');
});
});
// export default boot(({ app, urlPath, redirect }) => {
// });
export { client, account };
export { client, account, databases, ID };