achertovsky / yii2-user-advanced
Handy, light user extension with oauth and classical email login
Installs: 9
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:yii2-extension
pkg:composer/achertovsky/yii2-user-advanced
Requires
- php: >=5.6.0
 - achertovsky/yii2-handy-helpers: @dev
 - himiklab/yii2-recaptcha-widget: 2.1.1
 - rmrevin/yii2-fontawesome: 2.10.*
 - yiisoft/yii2: ~2.0.14
 - yiisoft/yii2-authclient: ~2.1.0
 - yiisoft/yii2-bootstrap4: ~2.0.0
 
This package is auto-updated.
Last update: 2022-06-28 09:10:52 UTC
README
Creted and tested for yii2-advanced-template ~2.0.14. Other support is not guaranteed, but expected and will be developed.
Will override default template user interaction, including:
- routes
 - identity class
 
installation, manual
pretty url
expected to work for template with enabled pretty routing and defined base route, so
-- to make it work uncomment\add part of components in your @app config/main.php
'urlManager' => [
    /**
     * 'baseUrl' is not defined at just-cloned template. expected it to be added
     */
    'baseUrl' => '/',
    //'baseUrl' => '/backend', //for backend
    
    'enablePrettyUrl' => true,
    'showScriptName' => false,
    'rules' => [
    ],
],
-- add to frontend/backend components -> request 'baseUrl',
'request' => [
    /**
     * ...
     */
    'baseUrl' => '',
    //'baseUrl' => '/backend', //for backend
],
add to modules section
'modules' => [
    'user' => [
        'class' => 'achertovsky\user\Module',
        /**
        * Current email will be used as sender in any email of this module
        *
        * @var string
        */
        'senderEmail' => 'desired.email@mailbox.com', // desired email
    ],
],
oauth
to make it work just configure corresponding class in components -> authClientCollection facebook, google works for sure. others wasnt tested, sorry
'authClientCollection' => [
    'class' => 'yii\authclient\Collection',
    'clients' => [
        /**
         * key name gonna be displayed on signup/login page
         * name it as you want it to displayed
         */
        'facebook' => [ 
            'class' => 'yii\authclient\clients\Facebook',
            'clientId' => '',
            'clientSecret' => '',
        ],
        // ... so on
    ],
],
migrations
Path is added via bootstrap, just ./yii migrate/up
suggestions:
- 
Higly suggested to do following actions in default frontend\controllers\SiteController:
- remove actionLogin
 - remove actionLogout
 - remove actionSignup
 - remove actionRequestPasswordReset
 - remove actionResetPassword
 - remove actionVerifyEmail
 - remove actionResendVerificationEmail
 - remove behaviors (unless you need it)
 - remove captcha action from actions() method
 
 - 
Higly suggested to do following actions in default backend\controllers\SiteController:
- remove actionLogin
 - remove actionLogout
 - remove behaviors (unless you need it)
 
 - 
Cleanup unused classes:
- frontend\models\ResendVerificationEmailForm
 - frontend\models\PasswordResetRequestForm
 
 - 
Cleanup unused views:
- backend/views/site/login.php
 - frontend/views/site/login.php
 - frontend/views/site/requestPasswordResetToken.php
 - frontend/views/site/resendVerificationEmail.php
 - frontend/views/site/resetPassword.php
 - frontend/views/site/signup.php
 - common/mail/*