diff --git a/auth.py b/auth.py index 15b9f17..ea5bee3 100644 --- a/auth.py +++ b/auth.py @@ -150,6 +150,16 @@ def require_secret(f): # this is required to track the devices connecting over the same ip address if 'device_id' not in session: session['device_id'] = os.urandom(32).hex() + + # AUTO-JUMP FOR TOKENS + try: + if args_token and is_valid_token(args_token): + token_item = decode_token(args_token) + target_foldername = token_item['folders'][0]['foldername'] + return redirect(f"path/{target_foldername}") + except Exception as e: + print(f"Error during auto-jump: {e}") + return f(*args, **kwargs) else: title_short = app_config.get('TITLE_SHORT', 'Default Title')