Skip to content
This repository was archived by the owner on Sep 29, 2023. It is now read-only.

Dart code fix in refreshing OAuth2 session #395

Merged
merged 3 commits into from
Jul 14, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 9 additions & 10 deletions app/views/docs/oauth-providers/github.md
Original file line number Diff line number Diff line change
Expand Up @@ -280,17 +280,16 @@ void main() async {

client
.setEndpoint('https://cloud.appwrite.io/v1') // YOUR API Endpoint
.setProject('[PROJECT_ID]') // YOUR PROJECT ID
;
.setProject('[PROJECT_ID]'); // YOUR PROJECT ID

// OAuth Login, for simplest implementation you can leave both success and
// failure link empty so that Appwrite handles everything.
final future = account.updateSession('current');
future.then(function (response) {
console.log(response); // Success
}, function (error) {
console.log(error); // Failure
});
// Simplest implementation of updating an OAuth2 session
// prints Session Object value on success and error message on failure
try {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remember to add the comments back in!

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the same comment that we have for OAuth Login sample. I will modify and add it back here 👍

final future = await account.updateSession(sessionId: 'current');
print(future.toMap()); // Success
} on AppwriteException catch(e){
print(e.message); // Failure
}
}
```

Expand Down