From 4d68d3d4574607999797e91c44c5095eb0370097 Mon Sep 17 00:00:00 2001 From: vanzhiganov Date: Sat, 16 Dec 2017 17:25:23 +0300 Subject: [PATCH] fix secret key --- config_file.ini | 1 + wotstats/views/home.py | 10 ++++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/config_file.ini b/config_file.ini index 4452473..5089c38 100644 --- a/config_file.ini +++ b/config_file.ini @@ -10,6 +10,7 @@ SQLALCHEMY_DATABASE_URI="postgres://wot:wot@192.168.1.47/wot" OPENID_FS_STORE_PATH="tmp" WG_REDIRECT_URL="http://wot.anzhiganov.com/token" +#WG_REDIRECT_URL="http://localhost:5000/token" WG_APPLICATION_ID="502910c1c785c3c7ca2e83c9e89bde02" # WG_OPENID_URL=https://eu.wargaming.net/id/openid/ WG_OPENID_URL="https://wargaming.net/id/openid/" diff --git a/wotstats/views/home.py b/wotstats/views/home.py index a48c068..ff66d46 100644 --- a/wotstats/views/home.py +++ b/wotstats/views/home.py @@ -102,9 +102,11 @@ def logout(): def token(): print request.args print request.form + print session + + #if 'openid' not in session or 'user' in session: + # return redirect(url_for('pages_home.index')) - if 'openid' not in session or 'user' in session: - return redirect(url_for('pages_home.index')) # ImmutableMultiDict([('status', u'ok'), ('access_token', u'a4d0a13df7c733102fbf6cd650794c6d047e91aa'), ('nickname', u'CrazyPants1999'), ('account_id', u'69552613'), ('', u'1505047809')]) if request.args.get('status') == 'ok' and request.args.get('access_token'): token = UserWotTokens.query.filter_by(user=session['user']) @@ -177,8 +179,8 @@ def create_or_login(resp): # flash(u'Successfully signed in') g.user = user - print session - if not session['token']: + print('session: {}'.format(session)) + if session['token'] is None: print('not token') return redirect(url_for('pages_home.token')) return redirect(oid.get_next_url())