Skip to content

BeforeLogin could provide the auth used to login #6662

@SebC99

Description

@SebC99

Is your feature request related to a problem? Please describe.
We let users create their account through various providers (email, facebook, google, etc.) and sometimes they forget which they used.
So when they try to login in the app after a while, they can try with an email/password and we would like to tell them they should use Facebook instead.

Describe the solution you'd like
The beforeLogin could be called even if a login failed, and we could have a status:failed and the authData provided by the client to login (for example the email), so that we could check if that user is a facebook user instead and return a specific error.
With the actual implementation, we can't do that, and the login will just failed without triggering the beforeLogin, and the user won't be able to know if he used a wrong password or a wrong provider.

Describe alternatives you've considered
The only way to do it for now, is to try to login, catch the error on client side, request a cloudfunction to check the user authentication method, and display the correct error message

Metadata

Metadata

Assignees

No one assigned

    Labels

    type:featureNew feature or improvement of existing feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions