balena-aws-lambda
balena-aws-lambda copied to clipboard
Failure with cloud function when account uses 2FA
When a device attempts to provision via the server side code, the server code first uses the balena API to validate that the device UUID is valid. The first step in validation is to login to the user's account with their email address and password. However if 2FA is enabled, this attempt fails with an error like,
Error: BalenaRequestError: Request error: Unauthorized
The solution is to login here with an API key token, via the sdk auth.loginWithToken()
function.
Link for affected support thread: https://jel.ly.fish/support-thread-1-0-0-front-cnv-cda40nh
Be sure to notify the reporter of that ticket when this issue is fixed.