From 9add6be8e49b649025cc512d1e37c23087438cfe Mon Sep 17 00:00:00 2001 From: Danielle McLean Date: Fri, 3 Nov 2017 16:40:09 +1100 Subject: [PATCH] Remove the pointless verify_auth_code wrapper - it's easier to do the verification work in the view anyway --- lemonauth/tokens.py | 4 ---- lemonauth/views/indie.py | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/lemonauth/tokens.py b/lemonauth/tokens.py index f69bb9c..814a46f 100644 --- a/lemonauth/tokens.py +++ b/lemonauth/tokens.py @@ -25,7 +25,3 @@ def gen_auth_code(req): code['sco'] = ' '.join(req.POST.getlist('scope')) return encode(code) - - -def verify_auth_code(c): - return decode(c) diff --git a/lemonauth/views/indie.py b/lemonauth/views/indie.py index 499f401..c44819c 100644 --- a/lemonauth/views/indie.py +++ b/lemonauth/views/indie.py @@ -92,7 +92,7 @@ class IndieView(TemplateView): def post(self, request): post = request.POST.dict() try: - code = tokens.verify_auth_code(post.get('code')) + code = tokens.decode(post.get('code')) except Exception: # if anything at all goes wrong when decoding the auth code, bail # out immediately.