hi i am geeting this error but the problem is that they coreectly working on localhost
but when switch to deployement and then a also change the url of web app on appwrite but getting this while authentication
here the code
API_ENDPOINT = "https://cloud.appwrite.io/v1" API_PROJECT_ID = "xxxxx" API_DATABASE_ID = "xxxxx" API_COLLECTION_ID = "xxxxx" REDIRECT_GOOGLE_AUTH = "xxxxxxx" FAILURE_ON_GOOGLE_AUTH = "xxxxxxx"
import { Client, Account, Databases, Storage } from 'appwrite';
export const client = new Client();
client
.setEndpoint(${process.env.API_ENDPOINT}
)
.setProject(${process.env.API_PROJECT_ID}
);
export const account = new Account(client); export const databases = new Databases(client); export const storage = new Storage(client); export { ID } from 'appwrite';
getCurrentUser : async () => { try { console.log("db ps", process.env.API_DATABASE_ID,) const res = await account.get(); if(res){ console.log(res) set({ userData: { userStatus: res.status, userID: res.$id, userEmail: res.email, userName: res.name, }, }); } } catch (error) { console.log("error on getting current user ",error) } },
this error geeting
TypeError: Failed to construct 'URL': Invalid URL at vY.<anonymous> (index-B2QdyW3V.js:302:24618) at Generator.next (<anonymous>) at index-B2QdyW3V.js:302:17993 at new Promise (<anonymous>) at Mt (index-B2QdyW3V.js:302:17790) at vY.get (index-B2QdyW3V.js:302:24558) at getCurrentUser (index-B2QdyW3V.js:306:645) at index-B2QdyW3V.js:889:14815 at nv (index-B2QdyW3V.js:40:24283) at E0 (index-B2QdyW3V.js:40:42409)
Recommended threads
- Update User Error
```ts const { users, databases } = await createAdminClient(); const session = await getLoggedInUser(); const user = await users.get(session.$id); if (!use...
- apple exchange code to token
hello guys, im new here 🙂 I have created a project and enabled apple oauth, filled all data (client id, key id, p8 file itself etc). I generate oauth code form...
- How to Avoid Double Requests in function...
I'm currently using Appwrite's `functions.createExecution` in my project. I want to avoid double requests when multiple actions (like searching or pagination) a...