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:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user