Fix trusted_device flag inversion in session creation

Corrects the logic for the trusted_device parameter when creating login sessions by inverting its value. This ensures that the session accurately reflects whether the device is trusted or not.
This commit is contained in:
咕谷酱
2025-10-12 03:17:56 +08:00
parent a8af03a464
commit 0e2df8dfef

View File

@@ -396,12 +396,12 @@ async def oauth_token(
if session_verification_method:
await LoginSessionService.create_session(
db, user_id, token_id, ip_address, user_agent.raw_ua, trusted_device, web_uuid, False
db, user_id, token_id, ip_address, user_agent.raw_ua, not trusted_device, web_uuid, False
)
await LoginSessionService.set_login_method(user_id, token_id, session_verification_method, redis)
else:
await LoginSessionService.create_session(
db, user_id, token_id, ip_address, user_agent.raw_ua, trusted_device, web_uuid, True
db, user_id, token_id, ip_address, user_agent.raw_ua, not trusted_device, web_uuid, True
)
return TokenResponse(