File tree Expand file tree Collapse file tree 1 file changed +18
-14
lines changed Expand file tree Collapse file tree 1 file changed +18
-14
lines changed Original file line number Diff line number Diff line change @@ -113,6 +113,24 @@ protected function createGitlabDriver()
113113 )->setHost ($ config ['host ' ] ?? null );
114114 }
115115
116+ /**
117+ * Create an instance of the specified driver.
118+ *
119+ * @return \Laravel\Socialite\One\AbstractProvider
120+ */
121+ protected function createTwitterDriver ()
122+ {
123+ $ config = $ this ->config ->get ('services.twitter ' );
124+
125+ if (($ config ['oauth ' ] ?? null ) === 2 ) {
126+ return $ this ->createTwitterOAuth2Driver ();
127+ }
128+
129+ return new TwitterProvider (
130+ $ this ->container ->make ('request ' ), new TwitterServer ($ this ->formatConfig ($ config ))
131+ );
132+ }
133+
116134 /**
117135 * Create an instance of the specified driver.
118136 *
@@ -143,20 +161,6 @@ public function buildProvider($provider, $config)
143161 );
144162 }
145163
146- /**
147- * Create an instance of the specified driver.
148- *
149- * @return \Laravel\Socialite\One\AbstractProvider
150- */
151- protected function createTwitterDriver ()
152- {
153- $ config = $ this ->config ->get ('services.twitter ' );
154-
155- return new TwitterProvider (
156- $ this ->container ->make ('request ' ), new TwitterServer ($ this ->formatConfig ($ config ))
157- );
158- }
159-
160164 /**
161165 * Format the server configuration.
162166 *
You can’t perform that action at this time.
0 commit comments