-
-
Notifications
You must be signed in to change notification settings - Fork 248
the ability to set User component by configuartion #218
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
taskibayev
commented
May 22, 2018
Q | A |
---|---|
Is bugfix? | no |
New feature? | yes |
Breaks BC? | |
Tests pass? | no |
Fixed issues | comma-separated list of tickets # fixed by the PR, if any |
hello So why i did it (created PR)? i'm working with CMS LUYA. and developing a account module for my project (project is not in github). i faced some problems when tried to configurate User component in app configuration. (which could be accessed by Yii::$app->getUser()) I confugurated User component in my account module (which colud be accessed by Yii::$app->getModule('account')->getUserIdentity() ) And i used this yii2-authclient to implement social-net-work authorization. After successfully authoration yiisoft/yii2-authclient redirects to url, which is retrived from Yii::$app->getUser(), which is app component. But i need to retrieve url from my module user component Yii::$app->getModule('account')->getUserIdentity() So in this PR i implemented ability to set user component by configuration. Code would like this:
` |
src/AuthAction.php
Outdated
* @var instance of \yii\web\User | ||
* user component, which might be set in different module | ||
*/ | ||
public $user; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it should allow setting ID of the component as well as configuration array instead of user instance only i.e. https://github.com/yiisoft/yii2/blob/master/framework/BaseYii.php#L342
confused with amend commit, so 1 commit turned into 2 commits. I'm not that strong with git, totaly confused with reverting commit. |
@lab362 please check if #230 works for you. Thanks. |