firebase-auth-lite icon indicating copy to clipboard operation
firebase-auth-lite copied to clipboard

fix: let `sendOobCode` return errors

Open MaxMonteil opened this issue 4 years ago • 1 comments
trafficstars

Because of the void return in sendOobCode, errors are not propagated and cannot be caught and handles in the UI.

This happens when sending an oob code to reset a password on a non existing email.

import Auth from 'firebase-auth-lite';

const auth = new Auth({ apiKey });
auth.sendOobCode('PASSWORD_RESET', '[email protected]');

This change only removes the void keyword.

MaxMonteil avatar Apr 05 '21 11:04 MaxMonteil

This also fixes await auth.sendOobCode() since it returns a Promise instead of undefined @samuelgozi

GeKorm avatar Mar 10 '22 01:03 GeKorm