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
- CORS error only on tables db api After u...
I've recently updated my self hosted appwrite instance to the 1.8.0 and updated my frontend with the tables db apis but strangely, even if I'm able to log in, g...
- [SOLVED] Access ExecutionStatus of a fun...
I am calling a cloud function from the newest Flutter SDK 20.2.1with the `xasync: false` flag and get the result, but the `execution.status` is not a String and...
- Appwrite isn't accepting the api from se...
Error creating user: AppwriteException: Server Error type: 'general_unknown', response: '{"message":"Server Error","code":500,"type":"general_unknown","versi...