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
- Helping in unblock my account
I deleted my Appwrite Cloud account that was linked via GitHub. Now I activated my GitHub Student Pack and want to sign up again using the same GitHub account, ...
- Not allowed permission to upsert a prese...
```js const presenceID = ID.unique(); setPID(presenceID); const presence = await presences.upsert({ presenceId: presenceID, status: "online"...
- Finding job
Hi. I am a full-stack developer with experience in developing scalable and user-friendly web applications. I handle both front-end and back-end development, im...