Hello,
Thanks for your work on this module. One feature I think is missing is the ability for users who already have accounts on the site to link to their Patreon account. (Currently, new users can register an account, but there doesn't seem to be an option for existing users - unless I'm missing something?)
Ideally I think a button on the user edit / account page, "Authorize with Patreon" or something to that effect, which launches the Oauth method at Patreon. Users login to Patreon and then are redirected to the site and are authenticated.
It seems like this functionality already exists in the module, but the methods are contained within the module's provided login blocks which only show for anonymous users.
I can probably write a patch for this, as it seems like it might be a simple addition.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | 3080710-patreon-account-link-3.patch | 5.82 KB | torgospizza |
Comments
Comment #2
mrdalesmith commentedHi @torgosPizza
That sounds like a useful bit of functionality, yes: I'll wait for a patch then :)
Comment #3
torgospizzaFinally, here's a patch which does the following:
user_is_anonymous()in the OAuth callback.Please review and test. (I also recommend applying the other child patches first, to make sure things like the Patreon ID are assigned to the account during this process.)
Thanks!
Comment #4
torgospizzaComment #6
mrdalesmith commentedCheers for the patch: I've committed into a new dev version of 7.2 to allow for testing.
Comment #7
torgospizzaI found an issue in the call to
patreon_fetch_user()that makes the module broken when this block is enabled. It seems to use an expired token, resulting in a "your token has expired or is invalid" error. It might require some static caching, which we can update when the token is refreshed. Need to dig in more, but for now setting to Needs Work until I can update the patch.Comment #8
mrdalesmith commentedI've added a link to Use external PHP library to handle Oauth on this ticket, as if I implement that it may well resolve the issue you've had here. It may be a while before I've done it though, as I'll develop against 8 first and then backport.
Comment #9
mrdalesmith commented