Skip to content

Commit 4e3d578

Browse files
authored
Merge pull request overtrue#58 from mingyoung/master
fix bugs
2 parents 8bd82c0 + 7c8c6ac commit 4e3d578

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/Middleware/OAuthAuthenticate.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public function handle($request, Closure $next, $scopes = null)
4040
$isNewSession = false;
4141
$onlyRedirectInWeChatBrowser = config('wechat.oauth.only_wechat_browser', false);
4242

43-
if ($onlyRedirectInWeChatBrowser && !$this->isWeChatBrowser()) {
43+
if ($onlyRedirectInWeChatBrowser && !$this->isWeChatBrowser($request)) {
4444
if (config('debug')) {
4545
Log::debug('[not wechat browser] skip wechat oauth redirect.');
4646
}
@@ -103,9 +103,10 @@ protected function needReauth($scopes)
103103
/**
104104
* Detect current user agent type.
105105
*
106+
* @param \Illuminate\Http\Request $request
106107
* @return bool
107108
*/
108-
protected function isWeChatBrowser()
109+
protected function isWeChatBrowser($request)
109110
{
110111
return strpos($request->header('user_agent'), 'MicroMessenger') !== false;
111112
}

0 commit comments

Comments
 (0)