Basic auth working

This commit is contained in:
2023-11-06 22:55:15 -05:00
parent edde4e79fd
commit 4a43b5813d
9 changed files with 138 additions and 99 deletions

View File

@@ -1,23 +1,22 @@
import { boot } from 'quasar/wrappers';
import { Client, Account } from 'appwrite';
import { Client, Account, ID } from 'appwrite';
export const client = new Client();
const client = new Client();
client
.setEndpoint('https://cloud.appwrite.io/v1')
.setProject('653ef6f76baf06d68034');
client.subscribe('account', (response) => {
console.log(response);
});
const account = new Account(client);
export const account = new Account(client);
// // TODO: Auto-logout on session deletion / expiry
// if (user.value) {
// client.subscribe('account', (response) => {
// console.log(response);
// });
// }
export default boot(({ app, urlPath, redirect }) => {
// Redirect to login page if unauthenticated.
try {
const current = await account.get();
} catch (err) {
redirect('/Login');
}
});
// export default boot(({ app, urlPath, redirect }) => {
// });
export { client, account };