diff --git a/app/views/docs/oauth-providers/github.md b/app/views/docs/oauth-providers/github.md index cd4764173..5993f7c36 100644 --- a/app/views/docs/oauth-providers/github.md +++ b/app/views/docs/oauth-providers/github.md @@ -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 + } } ```