How does Yii achieve third-party authorization and jump to the previous page?

normal operation procedure to be implemented:
1, click forum page (no authorization, forum/index)
2, click personal center (authorization required, member/index)
3, jump to user login (user/login)
4, click below third party authorization (such as Wechat user/auth?client=wechat)
5, Wechat authorization jumps to personal center (member/index);

currently (with Yii2 and yii-wx), you cannot jump to the personal center page through Yii::$app- > request- > getUrl () and Yii::$app- > request- > referrer .

protected function oauth()
    {
        $conf = Yii::$app->params["wx"]["mp"];

        //$url = Yii::$app->request->getUrl();
        $url = Yii::$app->request->referrer;

        //var_dump($url);die;
        $callback = Yii::$app->urlManager->createAbsoluteUrl(["/wechat/oauth", "url" => $url]);

        $conf["oauth"]["callback"] = urlencode($callback);
        $app = new Application(["conf" => $conf]);
        $oauth = $app->driver("mp.oauth");

        if (Yii::$app->user->isGuest) {
            $oauth->send();
            die;
        }
    }
Jun.08,2021

our ideas are similar, but I made a code and posted my

.
static public function oauth(){
    $conf = Yii::$app->params['wx']['mp'];
    $url = Yii::$app->request->getUrl();


    $callback = Yii::$app->urlManager->createAbsoluteUrl(['/site/oauth','url'=>urlencode($url)]);

    $conf['oauth']['callback'] = $callback;
    $app = new Application(['conf'=>$conf]);

    try {
        $oauth = $app->driver('mp.oauth');
    }catch(WxException $e){
        die('hacker');
    }

    if(Yii::$app->user->isGuest){
        $oauth->send();
        die();
    }
}
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b31bbb-2bdc4.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b31bbb-2bdc4.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?