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:
@@ -396,12 +396,12 @@ async def oauth_token(
|
|||||||
|
|
||||||
if session_verification_method:
|
if session_verification_method:
|
||||||
await LoginSessionService.create_session(
|
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)
|
await LoginSessionService.set_login_method(user_id, token_id, session_verification_method, redis)
|
||||||
else:
|
else:
|
||||||
await LoginSessionService.create_session(
|
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(
|
return TokenResponse(
|
||||||
|
|||||||
Reference in New Issue
Block a user