Allow setting custom start & done endpoints #679

Merged
merged 1 commit into from Oct 9, 2016

Projects

None yet

2 participants

@ragulka
Contributor
ragulka commented Sep 27, 2016

This PR allows setting custom login_start and login_done params, so that we can set the URL the user is redirected to when starting auth and when being redirected back from the provider. Note - this serves a different purpose than hauth_return_to. Let me explain...

Our use case may be a bit different than the majority, but we are migrating a WooCommerce plugin from OpAuth to HybridAuth. OpAuth uses different callback endpoints than HybridAuth. Some providers only allow redirecting back to specific endpoints (urls), even if the domain matches. One such example is Google. If the users of our plugin were to update their plugins to a newer version which uses HybridAuth, then some of their social login buttons would stop working, since the callback url is different from what it used to be. Ideally, we'd like to avoid this situation and give our users some time to update their callback urls without breaking the social logins. For this, we would need to make sure the callback urls match with the previous version. This is why we need a way to customize the actual endpoint URLs.

This change does not break or change any existing functionality, but will merely allow more advanced use-cases.

@StorytellerCZ
Contributor

I like this.
Could you also add some info about this into documentation so people know how to set it up properly?
Thanks!

@ragulka
Contributor
ragulka commented Sep 29, 2016

@StorytellerCZ thanks! where would I go to add documentation? there seems to be no docs in the repo itself.

@StorytellerCZ
Contributor
StorytellerCZ commented Sep 29, 2016 edited

We have the GitHub pages: https://github.com/hybridauth/hybridauth/tree/gh-pages
Plus there is also changelog, but I usually take care of that.

@ragulka ragulka added a commit to skyverge/hybridauth that referenced this pull request Sep 30, 2016
@ragulka ragulka [#679] Cleanup endpoint change tutorial, fix typos 2aa6356
@ragulka ragulka added a commit to skyverge/hybridauth that referenced this pull request Sep 30, 2016
@ragulka ragulka [#679] Document login_start and login_done params, tweak existing docs 66fb879
@ragulka
Contributor
ragulka commented Sep 30, 2016

@StorytellerCZ the docs are ready in #680 - can you take a look and tell me if that'll work?

@StorytellerCZ StorytellerCZ merged commit 2cdee3c into hybridauth:master Oct 9, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment