Answer the question
In order to leave comments, you need to log in
How to set the HTTPS protocol in the AuthChoice widget of the AuthClient extension from Yii2?
Situation: Using the AuthClient permission , there was a problem with the AuthChoice social button display widget .
Problem: AuthChoice generates a backlink for social networks with HTTP protocol, and Facebook requires HTTPS in recommend-force order.
To generate a URL, the widget takes the baseAuthUrl parameter , but you can set the relative path to the desired action as an array in it. Further, this data gets into Url::to() as the first parameter. But the second parameter of Url::to() , which is responsible for the protocol, is not allowed to be edited.
How to solve this problem? Perhaps I missed some parameter?
UPD:
Dug a little deeper. The problem is the same, but in a different place - \yii\authclient\BaseOAuth::defaultReturnUrl.
The returnURL is formed here, but just like in the widget, there is no way to set the protocol:
Answer the question
In order to leave comments, you need to log in
Alexander answered your question as follows:
BaseOAuth::defaultReturnUrl() doesn't specify protocol. It means return URL generated matches protocol used at the website. If your website is served via HTTP it doesn't make sense to set return URL to HTTPS.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question