From 3dd5b023b5b75ed7af02002219978c71238e1b9f Mon Sep 17 00:00:00 2001 From: keanemind Date: Sun, 29 Jul 2018 15:46:54 -0500 Subject: [PATCH] Check for error in case user cancels --- lostnphoned/sms.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lostnphoned/sms.py b/lostnphoned/sms.py index 98e2676..dd86bb1 100644 --- a/lostnphoned/sms.py +++ b/lostnphoned/sms.py @@ -192,6 +192,9 @@ def authorize(): def oauth2callback(): """Obtain credentials.""" + if flask.request.args.get('error', False): + return flask.redirect('/') + # Specify the state when creating the flow in the callback so that it can # verified in the authorization server response. state = flask.session['state']