You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is because the AuthChoise widget uses the authClientCollection only to created links to the AuthAction. You need two different AuthActions if we have auth with different permissions. I do not think there is something we can change in the auth-client extension about this. If you have any idea how this could be changed in auth-client extension, feel free to propose a soluition.
public function actions()
{
return [
'oauth' => [
'class' => AuthAction::class,
'successCallback' => [$this, 'authSuccessNew'],
// below new prop (type: array) added to AuthAction Class
// only one scope can be used at a time ie creating a widget AuthChoice
// this can be used to validate which scope (say 'repo') to apply out of available 2 below
'availableScopes' => ['user:email', 'repo'],
],
When I set
clientCollection
https://www.yiiframework.com/extension/yiisoft/yii2-authclient/doc/api/2.1/yii-authclient-widgets-authchoice#$clientCollection-detail
in
AuthChoice
https://www.yiiframework.com/extension/yiisoft/yii2-authclient/doc/api/2.1/yii-authclient-widgets-authchoice
like below
What steps will reproduce the problem?
Step 1: set in components array in web config file as
Step: 2 Set
SiteController
(or AuthController or any controller for login signup) (common for both above config)Note: for signin signup process scope
user:email
is enough but to get repo access we need scoperepo
see above config (link)Step 3: set this in any view file
What's expected?
github.com should ask user for repo permission
What do you get instead?
github.com is not asking user for repo permission. it just take config from
authClientCollection
as of now how I solved the issue
Create separate controller and its action that only control
myRepoAuthClientCollection
, sayNewController
it works fine.
Feel free to ask more details if needed
even i tried to use same
authClientCollection
likebut didn't worked
Additional info
The text was updated successfully, but these errors were encountered: