@@ -222,6 +222,7 @@ def load_settings(file=SETTINGS_FILE):
222
222
data ["token" ] = token
223
223
elif (data ["token" ] != "" ):
224
224
token = data ["token" ]
225
+ args .private_mode = True
225
226
226
227
if (args .remove_sources == False ):
227
228
args .remove_sources = data ["remove_sources" ]
@@ -299,10 +300,12 @@ def save_settings(request, file):
299
300
c .execute ("UPDATE settings SET password = ?" , (generate_password_hash (request .form ["new_password" ]),))
300
301
301
302
file = request .files ["cookie_file" ]
302
- if (args . private_mode or bool (request .form ["private_mode" ] == "true" )):
303
+ if (bool (request .form ["private_mode" ] == "true" )):
303
304
c .execute ("UPDATE settings SET token = ?" , (request .form ["token" ],))
305
+ args .private_mode = True
304
306
else :
305
- c .execute ("UPDATE settings SET token = ?" , ("" ,))
307
+ c .execute ("UPDATE settings SET token = ''" )
308
+ args .private_mode = False
306
309
#checks if the file is not empty
307
310
if file .filename != '' :
308
311
#checks if the file is a json file
@@ -377,6 +380,7 @@ async def index() -> str:
377
380
print ("start" )
378
381
if request .method == "GET" :
379
382
question = request .args .get (args .keyword ) #text
383
+ print (args .private_mode )
380
384
if (args .private_mode and request .args .get ("token" ) != data ["token" ]):
381
385
return "<p id='response'>Invalid token</p>"
382
386
print ("get" )
0 commit comments