mirror of
https://github.com/strapi/strapi.git
synced 2025-12-24 05:34:33 +00:00
Fix error 500 when user trying to signin with bad credentials
This commit is contained in:
parent
7bee86cdf7
commit
a468f82da0
@ -52,7 +52,7 @@ module.exports = {
|
||||
// Check if the user exists.
|
||||
const user = await strapi.query('user', 'users-permissions').findOne(query, ['role']);
|
||||
|
||||
if (_.get(await store.get({key: 'advanced'}), 'email_confirmation') && user.confirmed !== true) {
|
||||
if (_.get(await store.get({key: 'advanced'}), 'email_confirmation') && user && user.confirmed !== true) {
|
||||
return ctx.badRequest(null, ctx.request.admin ? [{ messages: [{ id: 'Auth.form.error.confirmed' }] }] : 'Your account email is not confirmed.');
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user