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
Cant login with admin/verysecret(Incorrect username or password.) but still can login with admin/admin and demo/demo.
web.php
`<?php
$params = require DIR . '/params.php';
$db = require DIR . '/db.php';
$config = [
'id' => 'basic',
'basePath' => dirname(DIR),
'bootstrap' => ['log'],
'aliases' => [
'@bower' => '@vendor/bower-asset',
'@npm' => '@vendor/npm-asset',
],
'modules' => [
'user' => [
'class' => Da\User\Module::class,
'administrators' => ['admin'],
]
],
'components' => [
'request' => [
// !!! insert a secret key in the following (if it is empty) - this is required by cookie validation
'cookieValidationKey' => '4RMpBfMQ8yb074gLRuGvihlTyOzfLAps',
],
'cache' => [
'class' => 'yii\caching\FileCache',
],
// 'user' => [
// 'identityClass' => 'app\models\User',
// 'enableAutoLogin' => true,
// ],
'errorHandler' => [
'errorAction' => 'site/error',
],
'mailer' => [
'class' => 'yii\swiftmailer\Mailer',
// send all mails to a file by default. You have to set
// 'useFileTransport' to false and configure transport
// for the mailer to send real emails.
'useFileTransport' => true,
],
'log' => [
'traceLevel' => YII_DEBUG ? 3 : 0,
'targets' => [
[
'class' => 'yii\log\FileTarget',
'levels' => ['error', 'warning'],
],
],
],
'db' => $db,
'authManager' => [
'class' => 'Da\User\Component\AuthDbManagerComponent',
],
/*
'urlManager' => [
'enablePrettyUrl' => true,
'showScriptName' => false,
'rules' => [
],
],
*/
],
'params' => $params,
];
if (YII_ENV_DEV) {
// configuration adjustments for 'dev' environment
$config['bootstrap'][] = 'debug';
$config['modules']['debug'] = [
'class' => 'yii\debug\Module',
// uncomment the following to add your IP if you are not connecting from localhost.
//'allowedIPs' => ['127.0.0.1', '::1'],
];
$config['bootstrap'][] = 'gii';
$config['modules']['gii'] = [
'class' => 'yii\gii\Module',
// uncomment the following to add your IP if you are not connecting from localhost.
//'allowedIPs' => ['127.0.0.1', '::1'],
];
}
return $config;
`
The text was updated successfully, but these errors were encountered:
If you have already created an user admin via the console command, you will not be able to use the example migration to create another admin user with different password.
The example migration is an example of how to create a new (non-existing) user.
if you already have an user with username admin, you can not add another one with the same name.
Migration will work for you if you do not have that user created already.
What steps will reproduce the problem?
I use yii2 basic template and follow installation(https://yii2-usuario.readthedocs.io/en/latest/) and add admin user(https://yii2-usuario.readthedocs.io/en/latest/helpful-guides/first-steps/) with no errors.
What is the expected result?
Can log in with admin/verysecret
What do you get instead?
Cant login with admin/verysecret(Incorrect username or password.) but still can login with admin/admin and demo/demo.
web.php
`<?php
$params = require DIR . '/params.php';
$db = require DIR . '/db.php';
$config = [
'id' => 'basic',
'basePath' => dirname(DIR),
'bootstrap' => ['log'],
'aliases' => [
'@bower' => '@vendor/bower-asset',
'@npm' => '@vendor/npm-asset',
],
'modules' => [
'user' => [
'class' => Da\User\Module::class,
'administrators' => ['admin'],
]
],
'components' => [
'request' => [
// !!! insert a secret key in the following (if it is empty) - this is required by cookie validation
'cookieValidationKey' => '4RMpBfMQ8yb074gLRuGvihlTyOzfLAps',
],
'cache' => [
'class' => 'yii\caching\FileCache',
],
// 'user' => [
// 'identityClass' => 'app\models\User',
// 'enableAutoLogin' => true,
// ],
'errorHandler' => [
'errorAction' => 'site/error',
],
'mailer' => [
'class' => 'yii\swiftmailer\Mailer',
// send all mails to a file by default. You have to set
// 'useFileTransport' to false and configure transport
// for the mailer to send real emails.
'useFileTransport' => true,
],
'log' => [
'traceLevel' => YII_DEBUG ? 3 : 0,
'targets' => [
[
'class' => 'yii\log\FileTarget',
'levels' => ['error', 'warning'],
],
],
],
'db' => $db,
'authManager' => [
'class' => 'Da\User\Component\AuthDbManagerComponent',
],
/*
'urlManager' => [
'enablePrettyUrl' => true,
'showScriptName' => false,
'rules' => [
],
],
*/
],
'params' => $params,
];
if (YII_ENV_DEV) {
// configuration adjustments for 'dev' environment
$config['bootstrap'][] = 'debug';
$config['modules']['debug'] = [
'class' => 'yii\debug\Module',
// uncomment the following to add your IP if you are not connecting from localhost.
//'allowedIPs' => ['127.0.0.1', '::1'],
];
}
return $config;
`
The text was updated successfully, but these errors were encountered: