Back

Getting null after createOAuth2Session

  • 0
  • Users
  • Flutter
Ellopis
7 Jun, 2023, 20:32
TypeScript
Account account = Account(client);
final res = await account.createOAuth2Session(provider: 'google');

I don't think it's the expected beh. is it? The account is created, but in the frontend the response is null

TL;DR
User is experiencing an issue where they are getting a null response after using the `createOAuth2Session` method in Flutter. They discuss the differences between `deleteSession` and `deleteSessions` methods and the required `sessionId` argument. No solution is provided in the thread.
Binyamin
7 Jun, 2023, 20:34
Ellopis
7 Jun, 2023, 20:46

.deleteSession() I supose is the method 😅

Binyamin
7 Jun, 2023, 20:46

Yep

Binyamin
7 Jun, 2023, 20:47

You can also use deleteSessions

Ellopis
7 Jun, 2023, 20:50

The difference is that one of them deletes the sessions across all devices (expire the access Token), and the other one only for the current device?

Binyamin
7 Jun, 2023, 20:50

Exactly, And the deleteSession requires you to pass 'current' to delete the current session.

Ellopis
7 Jun, 2023, 20:52

@Binyamin then I think the flutter documentation is wrong for those methods. deleteSession Use this endpoint to log out the currently logged in user from all their account sessions across all of their different devices. When using the Session ID argument, only the unique session ID provided is deleted. deleteSessions Delete all sessions from the user account and remove any sessions cookies from the end client.

Binyamin
7 Jun, 2023, 20:54

It's interesting what you've mentioned as the sessionId argument is required for deleteSession and there's no option to call with it without the argument.

Ellopis
7 Jun, 2023, 20:56

I'll check the source, and open issue if needed

Binyamin
7 Jun, 2023, 20:56

Sounds good 👍

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more