nuxt-alt/auth

User Data response does not contain field [object Object]

Closed this issue · 2 comments

cookie auth module prints this error:

User Data response does not contain field [object Object]

The code is incorrect:

if (process.client) {
userData = getProp(response, this.options.user.property.client);
}
else {
userData = getProp(response, this.options.user.property.server);
}
if (!userData) {
const error = new Error(`User Data response does not contain field ${this.options.user.property}`);

The error string should be referring to the specific field (client or server) not the aggregating object.

can you try version 2.5.0 and use user.property instead of user.property.server/user.property.client

Yes, seems to work without server: true in 2.5. Thanks.

Everything worked in 2.4, too, I just reported the mistake I noticed when setting it up.