Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support Laszlo

    (@laszloszalvak)

    Hi @georgcantor

    Yes, you can use the same “redirect” GET parameter that our own button uses, e.g.:

    where the redirect parameter should contain the URL-encoded URL of the page where you want to redirect to.

    Tip:

    If you check the “Usage” tab of each provider you can find another approach there, as well. If you inspect the simple link approach:

    you will see some some data attributes, if you have those attributes added, then via the “data-redirect” attribute you can also control the redirect. In our example, you will see it with the “current” value, that means we will try to redirect the user back to the same page where you pressed the button. But if you want to redirect to another URL, you can replace the “current” value with and URL instead, e.g.:

    <a  data-plugin="nsl" data-action="connect" data-redirect="https://yoursite.com/your-page" data-provider="google" data-popupwidth="600" data-popupheight="600">
    Click here to login or register
    </a>

    Best regards,
    Laszlo.

    Thread Starter georgcantor

    (@georgcantor)

    Amazing. That worked great. Thank you.

    Is there an advantage of useing the data-redirect instead of the query parameter?

    Also, if I may another question – a new user was created using the social registration (google). But the username created is just a random string. Isn’t there an option that the username would be just the first part of the users email before the @ sign?

    Plugin Support Laszlo

    (@laszloszalvak)

    I am glad it worked @georgcantor

    As for the attributes:

    If you use all of the data attributes, then some of our codes could affect even to the custom buttons, e.g.:

    • you could redirect the user back to the same page easily, via the “current” value as described above
    • also if you have the “Unsupported WebView behavior” setting set to “Remove button” then we could remove even the custom buttons associated with the providers that don’t support embedded browsers ( WebVew ). You can learn more about WebView specific limitations here:
      https://nextendweb.com/nextend-social-login-docs/can-use-nextend-social-login-webview/

    As for the username:

    We usually generate the random username,s if the provider doesn’t return any names, or the returned name consists of special characters which are not allowed in WordPress user names.

    If you would like to generate nicer names, then you can override the username over our “nsl_registration_user_data” filter:

    however please note that, not all providers return email addresses, e.g.: Facebook gives the users an option to hide it, and the X v2 API doesn’t return it at all. So prepare your custom code for cases like that.

    However please note that, the workaround described above requires some developer experience, as we can not provide support for custom coding or issues causes by them.

    Best regards,
    Laszlo.

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.