Yii Framework Forum: Login test fails - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Login test fails

#1 User is offline   QuPsi 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 72
  • Joined: 28-April 14

Posted 26 February 2018 - 04:03 PM

I'm a little confused by this one. The out of box unit test LoginFormTest fails after updating Yii2. The test that fails is "Login Correct". This is the error that I get:

[yii\base\InvalidConfigException] yii\web\Request::cookieValidationKey must be configured with a secret key.

Secret is configured in both fronted and backend. Login works just fine on my actual site. Not sure why the test fails now.

Some help would be appreciated.
Complete PHP/Yii n00b, so be nice to me :)
0

#2 User is offline   QuPsi 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 72
  • Joined: 28-April 14

Posted 06 March 2018 - 06:54 PM

View PostQuPsi, on 26 February 2018 - 04:03 PM, said:

I'm a little confused by this one. The out of box unit test LoginFormTest fails after updating Yii2. The test that fails is "Login Correct". This is the error that I get:

[yii\base\InvalidConfigException] yii\web\Request::cookieValidationKey must be configured with a secret key.

Secret is configured in both fronted and backend. Login works just fine on my actual site. Not sure why the test fails now.

Some help would be appreciated.


Solved the problem by adding

'components' => [
        'request' => [
            'cookieValidationKey' => 'XXXXXXXXX',
        ]


to main-local.php under 'common/config'.
Complete PHP/Yii n00b, so be nice to me :)
1

#3 User is offline   jacmoe 

  • Elite Member
  • Yii
  • Group: Moderators
  • Posts: 3,710
  • Joined: 10-October 10
  • Location:Denmark

Posted 08 March 2018 - 06:34 AM

Good thinking :)
"Less noise - more signal"
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users