Skip to content

Commit

Permalink
Support for the logout route and for the OAuth error validation
Browse files Browse the repository at this point in the history
  • Loading branch information
joamag committed Dec 28, 2018
1 parent f653b8e commit 7fb0077
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/examples/app.py
Expand Up @@ -129,9 +129,19 @@ def spreadsheet(self, id):
)
return contents

@appier.route("/logout", "GET")
def logout(self):
return self.oauth_error(None)

@appier.route("/oauth", "GET")
def oauth(self):
code = self.field("code")
error = self.field("error")
appier.verify(
not error,
message = "Invalid OAuth response (%s)" % error,
exception = appier.OperationalError
)
api = self.get_api()
access_token = api.oauth_access(code)
self.session["gg.access_token"] = access_token
Expand Down

0 comments on commit 7fb0077

Please sign in to comment.