Skip to content

fix: let sendOobCode return errors#63

Open
MaxMonteil wants to merge 1 commit into
samuelgozi:masterfrom
MaxMonteil:fix/sendOobCode-undefined-return
Open

fix: let sendOobCode return errors#63
MaxMonteil wants to merge 1 commit into
samuelgozi:masterfrom
MaxMonteil:fix/sendOobCode-undefined-return

Conversation

@MaxMonteil

@MaxMonteil MaxMonteil commented Apr 5, 2021

Copy link
Copy Markdown

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', 'invalid@email.com');

This change only removes the void keyword.

@GeKorm

GeKorm commented Mar 10, 2022

Copy link
Copy Markdown

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants