appwrite / sdk-for-web

[READ-ONLY] Official Appwrite Web SDK ๐Ÿงก
https://appwrite.io
BSD 3-Clause "New" or "Revised" License
271 stars 58 forks source link

๐Ÿ› Bug Report: cloud.appwrite.io/v1/account/sessions/current 400 (Bad Request) #87

Closed jgentes closed 3 months ago

jgentes commented 4 months ago

๐Ÿ‘Ÿ Reproduction steps

Issue await account.updateSession('current') which sends a request to https://cloud.appwrite.io/v1/account/sessions/current and results in AppwriteException: invalid_request: Missing required parameter: refresh_token

๐Ÿ‘ Expected behavior

The docs suggest using the string current to refresh the current session, however that appears to be an invalid request: https://appwrite.io/docs/references/cloud/client-web/account

๐Ÿ‘Ž Actual Behavior

400 response from the endpoint

๐ŸŽฒ Appwrite version

Version 0.10.x

๐Ÿ’ป Operating system

Windows

๐Ÿงฑ Your Environment

This is after authenticating with oAuth (Google) - I can issue account.getSession('current') and it returns fine. This is being issued from the browser, not Node.

๐Ÿ‘€ Have you spent some time to check if this issue has been raised before?

๐Ÿข Have you read the Code of Conduct?

stnguyen90 commented 3 months ago

@jgentes, thanks for raising this issue! ๐Ÿ™๐Ÿผ This method is used when a user has an OAuth2 session and they need to refresh the access token from the provider. is that what you're trying to do?

jgentes commented 3 months ago

Yes, this is after authenticating with oAuth (Google) - I can issue account.getSession('current') and it returns fine. This is being issued from the browser, not Node.

stnguyen90 commented 3 months ago

@jgentes, oh wait. you're trying to refresh a google oauth2 session? There's an open issue with google's oauth2 as we aren't getting the refresh token. I would suggest you add a ๐Ÿ‘๐Ÿผ to https://github.com/appwrite/appwrite/issues/5987. As that's the underlying issue, I'm going to close this as a duplicate.