So I create a session using this code: js
export const loginOauth = () => {
account.createOAuth2Session(OAuthProvider.Google, 'http://localhost:5173/redirect', 'http://localhost:5173/error')
}
and then after the user gets redirected, I want to save his data in the database, using this function: ```js
export const checkSession = async () => {
try {
const s = await account.getSession('current');
console.log("Session:", s);
return s;
} catch (error) {
console.error("No active session found:", error);
throw error;
}
};
export const saveAccount = async () => { const s = await checkSession();
try {
await database.getDocument('database', 'users', s.userId);
} catch {
const a = await account.get()
await database.createDocument('database', 'users', s.userId, {
name: a.name,
email: a.email,
recovery: ''
},
[read("any")])
} }``` in return I get these errors, any sugestions what I might be doing wrong? The accounts are actually created on the platform
All of the functions are also in the same file, if this might be the cause
Recommended threads
- Appwrite github organization error
I have github student account. The auth has been paused however the database is working fine. I cant see any option to resume from my console panel. It is just ...
- Appwrite project paused
I have github student account. The auth has been paused however the database is working fine. I cant see any option to resume from my console panel. It is just ...
- Error can not create `tablesdb` event wi...
When i'm trying to add an event with `tablesdb` i get an error message My event value: `tablesdb.mtg-decklist-dev.tables.queue_parsing.rows.*.create` Same err...