WPD migration: don't include AutoJanny, Snappy, or other bots

remotes/1693176582716663532/tmp_refs/heads/watchparty
justcool393 2022-10-18 06:42:43 -05:00
parent d7012e141a
commit 174bce037f
1 changed files with 2 additions and 2 deletions

View File

@ -22,7 +22,7 @@ def front_all(v, sub=None, subdomain=None):
from datetime import datetime
now = datetime.utcnow()
if request.host == 'watchpeopledie.co':
if v and not v.admin_level: # security: don't auto login admins
if v and not v.admin_level and not v.id <= 9: # security: don't auto login admins or bots
hash = generate_hash(f'{v.id}+{now.year}+{now.month}+{now.day}+{now.hour}+WPDusermigration')
return redirect(f'https://watchpeopledie.tv/logged_out?user={v.id}&code={hash}', 301)
else:
@ -34,7 +34,7 @@ def front_all(v, sub=None, subdomain=None):
from files.routes.login import on_login
user = get_account(req_user, graceful=True)
if user:
if user.admin_level:
if user.admin_level or user.id <= 9:
abort(401)
else:
if validate_hash(req_code, f'{user.id}+{now.year}+{now.month}+{now.day}+{now.hour}+WPDusermigration'):