cancel
Showing results for 
Search instead for 
Did you mean: 

How to return web url with Auth token

How to return web url with Auth token

Hi, I am implementing the login module and I need to return the url of the website linked to the token. Example. www.appsite.app/authtoken. However, I want to know if the way I did it is correct and follows magento best practices.

 

    public function returnUrlLogin($tokenKey) {

      $urlWithToken = $this->storeManager->getStore()->getBaseUrl(\Magento\Framework\UrlInterface::URL_TYPE_WEB) . "loginauth/?token=" . $tokenKey;

      return $urlWithToken;
         
    }

 

1 REPLY 1

Re: How to return web url with Auth token

Nice, 

 

If you want to know more Magento, take a tour the blog site of Landofcoder.

 

Thanks