How to show google auth error message in weweb?

I have installed the Google auth x Xano extension and have managed to successfully login with Google auth to my weweb app. I am using the Xano auth plugin.

The problem: Sometimes, the google authentication fails (Example, there is already a duplicate user). How do I get an error message to show to the user? Usually I either have a Weweb error message or Xano error message that can be shown to the user via a notification, but now user is redirected to a google page so I am unsure how to handle this.

Currently I am unable to show an error message, so user is redirected to login page and they do not know why the google auth authentication does not work as there is no error message.

Hi @raelyn :wave:

Could you maybe show us what it looks like in your project and walk us through a couple of errors?

For example, do you see an error in a screen like this or does the user go from clicking on the login button to being redirected back to the login page?

Hey @Joyce !

One key error I am facing is that I have set it such that only users with an existing account can log in with Google auth. So users with no account with us won’t be allowed through.

Here’s what happens: The user goes to the Google auth consent screen, picks the email, and then he is redirected straight back to the login page.

In the Xano end there’s already an error message, but not sure how to relay it to users?

Another error I am facing on the sign up page is the problem of duplicate records, being that user who already signed up with the same email on the sign up page using the password method, who later tries to log in / sign up with Google auth, will be unable to do so.

Similarly, they are redirected back to the log in page and they will be wondering why that happened and think that the google auth integration is broken, when it’s actually not…

@Joyce Hey Joyce! Any idea about this? :hugs:

Unfortunately nothing precise, no. I don’t have an active project with Google oauth + Xano at the moment. Makes it difficult for me to test and my brain isn’t great at working out abstract use cases :confused:

If the error is available in Xano, I think you should be able to access in a workflow and display it on the page.

If you want to send me a DM with a link to the editor and dummy credentials so I can try it, feel free to do so.

Hi @raelyn :wave:

I’m a little bit unclear about the flow of the signup and have a few questions for you.

1- You mention users need to be signed up otherwise they won’t be able to sign in with Google later but when I try to sign up, it’s a form that has nothing to do with Google.

Does that mean that you have a system in place that automatically adds the user’s email (the one they sign up with) to the Google Cloud Console to authorize their future log ins?

2- Are you confident everything is setup properly on the Xano / Google side of things?

Just tried to signup to your app but it’s telling me something’s not right with the uris configured in the Google Cloud Console:

More specifically, it would like to redirect me here but the uri is not authorized in Google:

From what I can tell, that’s the dashboard page where you want to send users after they successfully login:

But in WeWeb, you’re redirecting to a different page:

3- Regarding the issue of duplicate records with users who already signed up with the same email using the form, it’s something Q and I have noticed as well during our live streams. You might want to discuss this with the Xano team. I haven’t looked in to it but I’m sure there must be a way to recognize a user who does that is, in fact, a single record.