This repository was archived by the owner on Mar 25, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 48
This repository was archived by the owner on Mar 25, 2024. It is now read-only.
Login fails when 2FA is enabled (and how to fix it) #57
Copy link
Copy link
Open
Description
Describe the bug
If a user has 2FA enabled on their Eufy account, the login process fails due to not finishing the authentication flow
To Reproduce
Steps to reproduce the behavior:
- enable 2FA
- post email and password to https://mysecurity.eufylife.com/api/v1/passport/login
- observed that the response contains
"msg": "need validate code",
Expected behavior
I expect the login process to detect the need for a validation code and to execute the additional steps needed (detailed below)
Additional context
By inspecting the traffic sent by my browser, I was able to work out that the flow can be completed as follows in Postman:
- post to https://mysecurity.eufylife.com/api/v1/passport/login with the body
{ "email": "user@example.com", "password": "Some-g00d-password" } - observe that the response contains both
"msg": "need validate code"and"data": { "auth_token": "12baeasd..." }like so:{ "code": 26052, "msg": "need validate code", "data": { "user_id": "abc12343w534535rer", "email": "user@example.com", "nick_name": "user", "auth_token": "12baeasdfasdfawerawefasdfasdfasdf", "...": "..." } } - post to https://mysecurity.eufylife.com/api/v1/sms/send/verify_code with the header
X-Auth-Token: <the auth token value from the response above>with the body{ "message_type":2 } - get verification code from my email
- post to https://mysecurity.eufylife.com/api/v1/passport/login with the header
X-Auth-Token: <the auth token value from the response above>with the body{ "email": "user@example.com", "password": "Some-g00d-password", "verify_code": "< code from my email >" } - observe that the response contains
"msg": "ok"
I am not sure how to work this flow into this repo's code but doing so would make it work with 2FA enabled accounts.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels