2amigos / yii2-usuario

Highly customizable and extensible user management, authentication, and authorization Yii2 extension
https://github.com/2amigos/yii2-usuario
Other
292 stars 140 forks source link

Error while creating a new user or updating password in V1.6 #508

Open lawvisiondev opened 1 year ago

lawvisiondev commented 1 year ago

What steps will reproduce the problem?

After the update to v1.6 creating a new user or updating a password using the webinterface causes 500 internal server errors. Create User: (using new valid e-mail-address, new unique username, password Open new form - /index.php?r=user/admin/create After entering the username, password the console shows an 500 internal server error (jquery.js)

Console shows error: try { // Do send the request (this may raise an exception) xhr.send( options.hasContent && options.data || null ); } catch ( e ) { ... }

Log: 2023-02-24 21:08:09 [IP-ADDRESS][3][63kvbvmu2shmsb4aqsl05pb0jv][error][yii\base\UnknownPropertyException] yii\base\UnknownPropertyException: Getting unknown property: Da\User\Model\User::auth_tf_type in /var/www/html/WEBSITE/htdocs/advanced/vendor/yiisoft/yii2/base/Component.php:154

In Database field auth_tf_type is available (no value)

Update User. Same problem when updating a password/username of an existing user. (index.php?r=user/admin/update&id=5) Updating Profile-Data (f.ex. index.php?r=user/admin/update-profile&id=5) is working without problems

What is the expected result?

Create: New User is created Update: Updated Data (Username, Password, e-mail) is saved.

What do you get instead?

500 internal server error Getting unknown property: Da\User\Model\User::auth_tf_type

maxxer commented 1 year ago

Did you override the user model? Can you post module config?

lawvisiondev commented 1 year ago

No, there is no override for the user model. fyi: We use the yii2 advanced template with frontend and backend - usuario works with no problems until the update to v1.6

Here is my module config:

'modules' => [        
    'user' => [
        'class' => Da\User\Module::class,
        "administratorPermissionName" => 'admin',
        'enableGdprCompliance' => true,
        'enableRegistration' => false,
        'enableTwoFactorAuthentication' => false,
    ], ...

Thank you!

maxxer commented 1 year ago

how long ago did you run the migration? could it be you still have schema cached to the old version? can you try from cli

./yii cache/flush-schema
lawvisiondev commented 1 year ago

You are right. Now it works - m000000_000010_add_auth_tf_type_auth_tf_mobile_phone_columns_to_user_table.php caused the problem. Thank you!