Direct user to thirdparty login if email ends in "...
# support-questions
k
We will mainly use email/password login, but we wish for certain users to be redirected to a custom thirdparty login if their email ends in "X". I'm trying to override the "SignIn" func with the following:
Copy code
Functions: func(originalImplementation epmodels.RecipeInterface) epmodels.RecipeInterface {
                        originalSignInCode := *originalImplementation.SignIn

                        (*originalImplementation.SignIn) = func(email string, password string, userContext supertokens.UserContext) (epmodels.SignInResponse, error) {

                            if strings.Contains(email, "@X.com") {

                            }

                            return originalSignInCode(email, password, userContext)
                        }

                        return originalImplementation
                    },
But not sure how I would implement it actually. Can anyone help? 🙂
r
for this, it would be best if you build your own UI on the frontend which askss for the user's email first, and then based on that redirects them to the email password login UI or the third party login UI
on the backend, you can have checks in email password / third party sign in up override to make sure that the right email is signing up, and if not, throw some error.
k
that's ultimately what I thought, thanks for clarifying 🙂 I'll let our frontend guys implement login like this
r
great