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

Commit

Permalink
Merge pull request #395 from asutoshranjan/dart-code-fix
Browse files Browse the repository at this point in the history
Dart code fix in refreshing OAuth2 session
  • Loading branch information
Vincent (Wen Yu) Ge authored Jul 14, 2023
2 parents cc3f9be + 8e43d65 commit f3d82bd
Showing 1 changed file with 9 additions and 10 deletions.
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 {
final future = await account.updateSession(sessionId: 'current');
print(future.toMap()); // Success
} on AppwriteException catch(e){
print(e.message); // Failure
}
}
```

Expand Down

0 comments on commit f3d82bd

Please sign in to comment.