yii2-debug icon indicating copy to clipboard operation
yii2-debug copied to clipboard

MongoDb user with id = MongoDB/BSON/ObjectId

Open yii-bot opened this issue 7 years ago • 1 comments

This issue has originally been reported by @BenasPaulikas at https://github.com/yiisoft/yii2/issues/15189. Moved here by @cebe.


I'm not sure if this is a bug or I should handle it. :)

What steps will reproduce the problem?

Create users collection in mongodb. Login as user. Make auth key no more valid and /yii/web/user will try do this but id is not a string but ObjectId and it will throw Array to string conversion

Yii::warning("Invalid auth key attempted for user '$id': $authKey", METHOD);

What is the expected result?

Maybe do (string) $id ? I'm not sure

What do you get instead?

Array to string conversion exception

Additional info

Q A
Yii version 2.0.?
PHP version 7.1
Operating system Linux

yii-bot avatar Nov 21 '17 09:11 yii-bot

@cebe that doesn't seem to be debug issue but core one.

samdark avatar Nov 24 '17 06:11 samdark