In web
I created a session using oauth. I run the app logged in but closed the terminal and ran again opened the app(I have now 2 running app in different tab) session is ok close every tab and terminal re run the app there is no session. Either expo clearing the cookies set by appwrite or something else is happening . check is this is the reason
if (Platform.OS === 'web') {
// Web: get params from window.location
const params = new URLSearchParams(window.location.search);
const secret = params.get('secret');
const userId = params.get('userId');
if (secret && userId) {
try {
const res = await account.createSession(userId, secret);
console.log(res);
window.history.replaceState({}, document.title, window.location.pathname);
return await getAccount();
} catch (e) {
console.error('Failed to create session:', e);
return null;
}
}
return null;
}
this is my code. why am I using url search on window?
const result = await WebBrowser.openAuthSessionAsync(loginUrl, scheme);
this is opening a another window (smaller) and redirects in that window. My app is not able to catch that params, which is in the new window. so I set the redirect url as a screen for web and instead of opening new window i dont do anything and on redirect the screen catches the url and creates session. but after that the thing happens what i said at the start. Stuck on development. (Works on expo go)
Any thing I am doing wrong? I thought it was some kind of dev mode issue so i hosted it same thing happens
Recommended threads
- I’m facing an issue with deployments on ...
Hi Appwrite Support, I’m facing an issue with deployments on Appwrite Sites. A few days ago (around 3–4 days back), everything was working perfectly. My deplo...
- Appwrite Cloud project is paused and nev...
Hi Appwrite Team & Community, I am facing a problem with one of my Appwrite Cloud projects which seems to be identical to the other cases of "paused projects" ...
- Timed out waiting for runtime error
execution id 6a3e0791978712d81ee0 im having issue with appwrite function runtime performance. even after 4gbram and cpu same function sometimes completes in a...