Permalink
Browse files

Better Oauth support

  • Loading branch information...
joamag committed Dec 28, 2018
1 parent c1be0a1 commit 97d707b747caf24a1aab0b70dc751d5c6a7ef51a
Showing with 9 additions and 0 deletions.
  1. +9 −0 src/examples/app.py
@@ -70,9 +70,18 @@ def photos_set(self, id):
photos = api.photos_set(id)
return photos

@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 97d707b

Please sign in to comment.