
I saw the documentation but need help about the redirect url. In expo, the user account is created but I am redirected to a separate project in web , the smaller web window is opened and account is created but the smaller window does not close but opens the web app again (I assume redirects ) in that small window. Never used oauth before 🙂 Here is the code
const deepLink = new URL(makeRedirectUri({preferLocalhost: true}));
if (!deepLink.hostname) {
deepLink.hostname = 'localhost';
}
const scheme = `${deepLink.protocol}//`; // e.g. 'exp://' or 'playground://'
// Start OAuth flow
const loginUrl = await account.createOAuth2Token(
provider,
`${deepLink}`,
`${deepLink}`,
);
// Open loginUrl and listen for the scheme redirect
const result = await WebBrowser.openAuthSessionAsync(`${loginUrl}`, scheme);
// Extract credentials from OAuth redirect URL
const url = new URL(result.url);
const secret = url.searchParams.get('secret');
const userId = url.searchParams.get('userId');
// Create session with OAuth credentials
const res = await account.createSession(userId, secret);
console.log('Session created:', res);
// Redirect as needed

I also wanted to know if I have to change anything if the site is deployed or I make a apk version instead of using localhost or expo

More info about expo redirecting to a wrong project when The web browser closes expo shows this

in web its like this
Recommended threads
- Auto confirm team membership / emails no...
Hello, I'm using the Appwrite via the Cloud platform. I've started to use the Teams API, however emails are not arriving - this wouldn't be a problem if I was a...
- root api key
How to create or if it is possible to get root api key? I'd like to be able to create programatically project for every new client.
- Creating function on repo cant find main...
I have a repo for cloud functions, which I initially set to private and all worked fine. I had to change it to public for some time and now I set it back to pri...
