Permalink
Browse files

Support for the logout route and for the OAuth error validation

  • Loading branch information...
joamag committed Dec 28, 2018
1 parent 571fe5c commit de79ee3dc67ac89852858ae0af603b00e44e6c5b
Showing with 9 additions and 0 deletions.
  1. +9 −0 src/examples/app.py
@@ -79,9 +79,18 @@ def search(self):
results = api.tweets_search(query)
return results

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

@appier.route("/oauth", "GET")
def oauth(self):
oauth_verifier = self.field("oauth_verifier")
appier.verify(
oauth_verifier,
message = "Invalid OAuth response",
exception = appier.OperationalError
)
api = self.get_api()
oauth_token, oauth_token_secret = api.oauth_access(oauth_verifier)
self.tokens(oauth_token, oauth_token_secret, temporary = False)

0 comments on commit de79ee3

Please sign in to comment.