Compare commits

...

2 Commits

Author SHA1 Message Date
Lynne Megido 5f2f19519f
fixed link to code in footer 2018-11-14 00:10:40 +10:00
Lynne Megido 6c45c47497
logout on failure 2018-11-14 00:04:50 +10:00
2 changed files with 6 additions and 4 deletions

View File

@ -1,5 +1,5 @@
<div id='footer'>
Note that Curious Greg uses a cookie to store your login state. Deleting the cookie used by Curious Greg will log you out of your account. Posting will still function as normal.<br />
Created by <a target="_blank" href='https://fedi.lynnesbian.space/@lynnesbian'>@lynnesbian@fedi.lynnesbian.space</a> (message her about any bugs you find). Source code is available <a target="_blank" href='https://git.lynnesbian.space/curious-greg'>here</a>, under the <a target="_blank" href='https://www.mozilla.org/en-US/MPL/2.0/'>Mozilla Public License Version 2.0</a>.<br />
Created by <a target="_blank" href='https://fedi.lynnesbian.space/@lynnesbian'>@lynnesbian@fedi.lynnesbian.space</a> (message her about any bugs you find). Source code is available <a target="_blank" href='https://git.lynnesbian.space/lynnesbian/curious-greg'>here</a>, under the <a target="_blank" href='https://www.mozilla.org/en-US/MPL/2.0/'>Mozilla Public License Version 2.0</a>.<br />
Curious Greg is currently in beta. Bugs may be present. There is <strong>no risk</strong> of Curious Greg deleting any of your posts.
</div>

8
web.py
View File

@ -56,10 +56,12 @@ def main():
def home():
if 'acct' in session:
dc.execute("SELECT * FROM data WHERE username = %s AND instance = %s", (session['username'], session['instance']))
#TODO: if this fails, redirect to /logout
data = dc.fetchone()
for item in ['username', 'instance', 'avi', 'secret', 'client_id', 'client_secret', 'cc', 'ccavi']:
session[item] = data[item]
try:
for item in ['username', 'instance', 'avi', 'secret', 'client_id', 'client_secret', 'cc', 'ccavi']:
session[item] = data[item]
except:
return redirect('/logout') #TODO: not good UX
if 'cc' not in session:
session['cc'] = "None"