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
- CORS errors in Obsidian custom plugin
Hi, anyone here familiar with obsidian community plugins? In short: it's a local first note app which supports writing your own add-ons / plugin But I keep get...
- > AppwriteException: The requested servi...
When trying to read or write from my database I get the following error: > AppwriteException: The requested service is disabled. You can enable the service from...
- Courtesy limit reset for non-profit migr...
Hi Team! I'm the architect for a 501(c)(3) non-profit project (Aaria's Blue Elephant) and we just hit our Free plan Database Read limit (currently at 164%). Th...