Google authentication Error Answered

Post author
Bas Rijnen

Integrated google authentication today. Signing up is working properly now, however when I log in with an account which has signed up with google, this error is returned after the redirect. Anybody knows what's up here?

Comments

13 comments

  • Comment author
    Josh Lopez

    Hey Bas Rijnen πŸ‘‹

    What is your url so we can look at this further?

    0
  • Comment author
    Bas Rijnen

    Josh Lopez https://sleak.chat

    To replicate, first sign up through google auth, then skip onboarding and navigate to /dashboard to log out. Finally, log in with the same google account via /login

    0
  • Comment author
    Tyler Bell

    Bas Rijnen https://www.loom.com/share/5e585a88cf30461f9902d9b12fc8e802

    0
  • Comment author
    Bas Rijnen

    Hi Tyler Bell, thanks for looking into it.

    I removed the value of this field, and indeed after removing it I was able to log in.

    However, I don't see this as a proper solution as next to this field (which is automatically generated and filled by Zapier after sign-up), there are multiple other rich text area input fields which need to be filled in by our users with multi-line input.

    I never had any trouble with these fields anywhere in my application before, so wouldn't this rather be an issue with the Google auth integration?

    Now, all fields are returned after Google Auth redirect. Is this necessary? If these fields are just removed from the payload the problem would be solved right?

    Tyler Bell Could you guys look into this? : )

    It's kind of a big struggle for us at the moment, users we paid for are signing up and they can't log in atm. πŸ™

    0
  • Comment author
    Tyler Bell

    Bas Rijnen Sorry for the slow reply here.
    This is on my list to address today.

    0
  • Comment author
    Bas Rijnen

    No problem! Was just checking in πŸ™‚

    And that is great - thank you very much.

    0
  • Comment author
    Tyler Bell

    We just replicated the issue on our end.

    Working on a fix now.

    Bas Rijnen problem should be fixed now πŸ™‚

    0
  • Comment author
    Bas Rijnen

    Ah that's perfect!! Thank you very much for the fix πŸ™

    Tyler Bell So 1 more thing, the first name seems to not get passed into MS. Can it be that I have incorrectly set up my Google 0Auth?

    0
  • Comment author
    Tyler Bell

    Do you have a name or first-name field in Memberstack?

    The key has to be exact.

    0
  • Comment author
    Bas Rijnen

    Tyler Bell I'm using first-name in my regular signup fields. But this is independent from the google auto right?

    Or is it not possible to pass first name only with Google?

    It's quite unfortunate because when only passing full name, personalisation (dashboard, e-mail flows) is not really possible

    Tyler Bell Do you think this would be possible? Perhaps with a workaround

    0
  • Comment author
    Tyler Bell
    export const getCompatibleFields = (customFields: CustomField[], userInfo: userInfo) => {
    const fields = {}
    if (userInfo.name && customFields.some((field) => { return field.key === "name" })) {
    fields["name"] = userInfo.name
    }

    const hasFields = customFields.some((field) => { return field.key === "first-name" || field.key === "last-name" });

    if ((userInfo.given_name || userInfo.family_name) && hasFields) {
    fields["first-name"] = userInfo.given_name
    fields["last-name"] = userInfo.family_name
    }

    //@ts-ignore
    if ((userInfo.first_name || userInfo.last_name) && hasFields) {
    //@ts-ignore
    fields["first-name"] = userInfo.first_name
    //@ts-ignore
    fields["last-name"] = userInfo.last_name
    }

    return fields
    }

    This is the function in our system that pairs social auth fields to custom fields.
    Based on that, if you do have a first-name field, I’d expect it to equal the given_name provided by the auth provider.

    In your app (associated with https://www.sleak.chat/), I don’t see a first-name custom field πŸ€”

    0
  • Comment author
    Bas Rijnen

    Thanks!

    And I think I understand now. I was in fact already using both first-name and last-name, however they were just added in WF through a component from a MS template. We just never added it as a custom field in the MS dashboard. They were already pushed in json objects of members though (for instance through Zapier), so we already used them in mail automations etc. I just added the custom fields in the MS backend as well, and now it's working πŸ™‚

    0
  • Comment author
    Tyler Bell

    Yay!

    0

Please sign in to leave a comment.