fix(middleware): prevent premature redirect to /login during loading

Users were incorrectly redirected to /login during the initial loading phase
before the loading was actually complete. Added loading_started and
loading_complete flags to properly track the initialization state so
the setup redirect middleware knows when it's safe to redirect.
This commit is contained in:
2026-06-07 20:23:11 +02:00
parent b800158648
commit de250bdd37
5 changed files with 43 additions and 7 deletions

View File

@@ -117,6 +117,10 @@ async def setup_auth(req: SetupRequest):
# Store master password hash in config's other field
config.other['master_password_hash'] = password_hash
# Mark that loading has been initiated (used by middleware to prevent
# premature redirect to /login after setup)
config.other['loading_started'] = True
# Store anime directory in config's other field if provided
anime_directory = None
if req.anime_directory: