@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Support Twitch.tv as an OAuth provider

Summary:
This is mostly for personal reasons / lols, but they have a perfectly functional OAuth2 API and it takes like 15 minutes to add a provider now and I was in this code anyway...

@chad, we could use JIRA, Twitter and Twitch.tv auth icons if you have a chance.

Test Plan: {F53564}

Reviewers: btrahan, chad

Reviewed By: btrahan

CC: aran

Differential Revision: https://secure.phabricator.com/D6706

+38
+2
src/__phutil_library_map__.php
··· 901 901 'PhabricatorAuthProviderOAuthFacebook' => 'applications/auth/provider/PhabricatorAuthProviderOAuthFacebook.php', 902 902 'PhabricatorAuthProviderOAuthGitHub' => 'applications/auth/provider/PhabricatorAuthProviderOAuthGitHub.php', 903 903 'PhabricatorAuthProviderOAuthGoogle' => 'applications/auth/provider/PhabricatorAuthProviderOAuthGoogle.php', 904 + 'PhabricatorAuthProviderOAuthTwitch' => 'applications/auth/provider/PhabricatorAuthProviderOAuthTwitch.php', 904 905 'PhabricatorAuthProviderPassword' => 'applications/auth/provider/PhabricatorAuthProviderPassword.php', 905 906 'PhabricatorAuthRegisterController' => 'applications/auth/controller/PhabricatorAuthRegisterController.php', 906 907 'PhabricatorAuthStartController' => 'applications/auth/controller/PhabricatorAuthStartController.php', ··· 2939 2940 'PhabricatorAuthProviderOAuthFacebook' => 'PhabricatorAuthProviderOAuth', 2940 2941 'PhabricatorAuthProviderOAuthGitHub' => 'PhabricatorAuthProviderOAuth', 2941 2942 'PhabricatorAuthProviderOAuthGoogle' => 'PhabricatorAuthProviderOAuth', 2943 + 'PhabricatorAuthProviderOAuthTwitch' => 'PhabricatorAuthProviderOAuth', 2942 2944 'PhabricatorAuthProviderPassword' => 'PhabricatorAuthProvider', 2943 2945 'PhabricatorAuthRegisterController' => 'PhabricatorAuthController', 2944 2946 'PhabricatorAuthStartController' => 'PhabricatorAuthController',
+36
src/applications/auth/provider/PhabricatorAuthProviderOAuthTwitch.php
··· 1 + <?php 2 + 3 + final class PhabricatorAuthProviderOAuthTwitch 4 + extends PhabricatorAuthProviderOAuth { 5 + 6 + public function getProviderName() { 7 + return pht('Twitch.tv'); 8 + } 9 + 10 + public function getConfigurationHelp() { 11 + $login_uri = $this->getLoginURI(); 12 + 13 + return pht( 14 + "To configure Twitch.tv OAuth, create a new application here:". 15 + "\n\n". 16 + "http://www.twitch.tv/settings/applications". 17 + "\n\n". 18 + "When creating your application, use these settings:". 19 + "\n\n". 20 + " - **Redirect URI:** Set this to: `%s`". 21 + "\n\n". 22 + "After completing configuration, copy the **Client ID** and ". 23 + "**Client Secret** to the fields above. (You may need to generate the ". 24 + "client secret by clicking 'New Secret' first.)", 25 + $login_uri); 26 + } 27 + 28 + protected function newOAuthAdapter() { 29 + return new PhutilAuthAdapterOAuthTwitch(); 30 + } 31 + 32 + protected function getLoginIcon() { 33 + return 'Twitch'; 34 + } 35 + 36 + }