PHP Class Overtrue\LaravelWechat\Middleware\OAuthAuthenticate

Show file Open project: overtrue/laravel-wechat

Public Methods

Method Description
__construct ( Application $wechat ) Inject the wechat service.
handle ( Illuminate\Http\Request $request, Closure $next, string | null $scopes = null ) : mixed Handle an incoming request.

Protected Methods

Method Description
getTargetUrl ( Request $request ) : string Build the target business url.
isWeChatBrowser ( ) : boolean Detect current user agent type.
needReauth ( array $scopes ) : boolean Is different scopes.

Method Details

__construct() public method

Inject the wechat service.
public __construct ( Application $wechat )
$wechat EasyWeChat\Foundation\Application

getTargetUrl() protected method

Build the target business url.
protected getTargetUrl ( Request $request ) : string
$request Request
return string

handle() public method

Handle an incoming request.
public handle ( Illuminate\Http\Request $request, Closure $next, string | null $scopes = null ) : mixed
$request Illuminate\Http\Request
$next Closure
$scopes string | null
return mixed

isWeChatBrowser() protected method

Detect current user agent type.
protected isWeChatBrowser ( ) : boolean
return boolean

needReauth() protected method

Is different scopes.
protected needReauth ( array $scopes ) : boolean
$scopes array
return boolean