
Hi, I have a problem to login via google oAuth in my Flutter mobile app. What should return createOAuth2Session function? In my case, after login by google I get a screen with "missing redirect..." error just for second and then back to login page. Function returns null and session is not created. But in Appwrite console I see that account is created and verified.

right...it actually doesn't return the session, but the user should be authenticated based on the flow you describe π§

Are you able to call account.get()
right after?

yes, I call account.get() and have 401 error. Strange because in Appwrite panel I see that account is created and even session

what's your code? Are you using the same Client
instance across your codebase?

I've looked into this issue a bit more. And I know exactly when it occurs. In the first video, I log in to the account that is saved earlier in the browser. Log in works and logout does the same. In the second video, I log in to an account that is not saved in the browser. I enter the password and login succeeds. However, log out is not successful. It's strange because before( by account.get() ) method I check the previously created session and close the login page based on this. The session is also visible in Appwrite panel

Log in to account that is saved earlier? Appwrite sdk persists sessions so you shouldn't have to log in again π§

What's the code with the account.get() and logout?

And how are you initializing and using Client in your codebase?

No. I mean I saved before credential in browser only. Then I open my app. In 1st video everything is ok. I login only once and session is holded. Sesond video is after reinstallation app and delete credential from browser

Weird...that shouldn't affect the oauth flow...

I will send piece of code tommorow
Recommended threads
- Flutter 3.32 Upgrade Warning β Appwrite ...
Hey everyone, just a heads-up after upgrading to Flutter 3.32! This likely wonβt impact your development, but I wanted to give you a quick warning. ``` [log] W...
- user_unauthorized
"I tried to use the CLI, but it returns user_unauthorized. Iβm already logged in with my Appwrite account. Could there be an issue on the cloud side?" `erdene...
- OAuth2 with IPhone When users enables "H...
I am using Appwrite OAuth2 to authenticate users in my app (Flutter) Normally, I am using the user's email for the authentication, when he first registers , and...
