Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Catch all errors from sign in - improvement for signInFailure #1074

Open
Boardtale opened this issue Mar 3, 2024 · 4 comments
Open

Catch all errors from sign in - improvement for signInFailure #1074

Boardtale opened this issue Mar 3, 2024 · 4 comments

Comments

@Boardtale
Copy link

Boardtale commented Mar 3, 2024

Need:

I require for email + pwd to verify emails.
As far as I know, I can't prevent or redirect flow after user first time creates account. So the error is sent from my blocking function: 'please verify email'.
That does not look good when user tries to log in with unverfied email:
image
I want to catch that error and show proper error popup for the users.

I am using 'signInFailure' but it's not triggered.. I think ever :P I don't know where it's triggered but not if I get any forbidden from my blocking function

So I'd like to solve it somehow. I see few paths but neither is possible - afaik - with firebaseUI. Unless I'm gonna dirty trick it and break encapsulation.

  1. Stop auto sign in after creation of the account for email. I could redirect user in such case to dedicated page where I ask him to verify account. Also I need to be able to send that email there! So it's important for me to get handler
  2. Ignore the flow, but be able to catch all errors. Some kind of generic catch for all that thing.

EDIT:

I guess I could do this manually on my own backend, after login, check if verified email and then redirect them also logging them out. But that's many additional actions

@Thanush19
Copy link

i can fix this @Boardtale
can i work on this??

@jhuleatt
Copy link
Collaborator

Hi @Boardtale, thanks for reporting this. I agree that signInFailure should trigger if account creation or sign-in is blocked by a blocking function. We'll mark this as a bug.

As a side note, would email link authentication be a better fit for your use case than email + password?

@HartGit01
Copy link

HartGit01 commented Mar 28, 2024 via email

@hungrydaddy
Copy link

hungrydaddy commented Jul 8, 2024

Glad that I can confirm that I am not the only one experiencing this.
My case is really similar where I am blocking user creation in the beforeCreate blocking function, returning a custom error that I prepare to catch and handle on the frontend to display a user-friendly error.
Unfortunately I am in the same boat here @Boardtale , there seems no way to catch this error anywhere.

The only potential approach for me now is to use firebase SDK to initiate sign in flow which then defeats the purpose of me using this library.

Edit:
Sorry I did not mention this, but for me this happens when a user tries to sign up using a Social sign in (Google/Microsoft).

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

No branches or pull requests

5 participants