Clean up all kinds of typescript issues

This commit is contained in:
2024-05-05 15:58:58 -04:00
parent 634cff507c
commit 8e73650462
21 changed files with 380 additions and 159 deletions

View File

@@ -1,6 +1,6 @@
import { defineStore } from 'pinia';
import { ID, account } from 'boot/appwrite';
import type { Models } from 'appwrite';
import { OAuthProvider, type Models } from 'appwrite';
import { ref } from 'vue';
export const useAuthStore = defineStore('auth', () => {
@@ -21,12 +21,12 @@ export const useAuthStore = defineStore('auth', () => {
return await login(email, password);
}
async function login(email: string, password: string) {
await account.createEmailSession(email, password);
await account.createEmailPasswordSession(email, password);
currentUser.value = await account.get();
}
async function googleLogin() {
account.createOAuth2Session(
'google',
OAuthProvider.Google,
'https://bab.toal.ca/',
'https://bab.toal.ca/#/login'
);