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

Commit f3d82bd

Browse files
author
Vincent (Wen Yu) Ge
authored
Merge pull request #395 from asutoshranjan/dart-code-fix
Dart code fix in refreshing OAuth2 session
2 parents cc3f9be + 8e43d65 commit f3d82bd

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

app/views/docs/oauth-providers/github.md

+9-10
Original file line numberDiff line numberDiff line change
@@ -280,17 +280,16 @@ void main() async {
280280
281281
client
282282
.setEndpoint('https://cloud.appwrite.io/v1') // YOUR API Endpoint
283-
.setProject('[PROJECT_ID]') // YOUR PROJECT ID
284-
;
283+
.setProject('[PROJECT_ID]'); // YOUR PROJECT ID
285284
286-
// OAuth Login, for simplest implementation you can leave both success and
287-
// failure link empty so that Appwrite handles everything.
288-
final future = account.updateSession('current');
289-
future.then(function (response) {
290-
console.log(response); // Success
291-
}, function (error) {
292-
console.log(error); // Failure
293-
});
285+
// Simplest implementation of updating an OAuth2 session
286+
// prints Session Object value on success and error message on failure
287+
try {
288+
final future = await account.updateSession(sessionId: 'current');
289+
print(future.toMap()); // Success
290+
} on AppwriteException catch(e){
291+
print(e.message); // Failure
292+
}
294293
}
295294
```
296295

0 commit comments

Comments
 (0)