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
- The current user is not authorized to pe...
I want to create a document associated with user after log in with OAuth. The user were logged in, but Appwrite said user is unauthorized. User is logged in wi...
- Attributes Confusion
```import 'package:appwrite/models.dart'; class OrdersModel { String id, email, name, phone, status, user_id, address; int discount, total, created_at; L...
- Current User is Not authorized
recreating same Thread