Closed edzillion closed 5 years ago
Equivalent PR on API https://github.com/CirclesUBI/circles-api/pull/78
AuthSaga initRecoverAccount() signs a message (a timestamp) and sends to API. phone_number and device_id sent in case of phone number or device change.
AuthSaga initRecoverAccount()
phone_number
device_id
body: { message: message, signature: signature, device_id: DeviceInfo.getUniqueID(), phone_number: phone }
usersController.recoverAccount() logic overview:
usersController.recoverAccount()
message
recoverAddress()
signature
getSNSEndpoint()
createSNSEndpoint()
updateSNSEndpoint
updatePhone()
user
At this point the user is signed out and will need to sign in or even use forgot password to recover the login credentials.
Equivalent PR on API https://github.com/CirclesUBI/circles-api/pull/78
FE
AuthSaga initRecoverAccount()
signs a message (a timestamp) and sends to API.phone_number
anddevice_id
sent in case of phone number or device change.API
usersController.recoverAccount()
logic overview:message
to see if timestamp is less than 2.5 minutes old and not in the future. If fail then send 403recoverAddress()
frommessage
andsignature
getSNSEndpoint()
from aws snscreateSNSEndpoint()
device_id
has changed thenupdateSNSEndpoint
phone_number
has changed thenupdatePhone()
on aws cognitouser
to FEAt this point the user is signed out and will need to sign in or even use forgot password to recover the login credentials.