Skip to content
Snippets Groups Projects
Commit a5351369 authored by Lucendio's avatar Lucendio
Browse files

[app/server] Fix refactoring left-over, where as a result login didnt work anymore

parent ab11e23b
No related branches found
No related tags found
No related merge requests found
...@@ -48,7 +48,7 @@ schema.pre('save', async function (next) { ...@@ -48,7 +48,7 @@ schema.pre('save', async function (next) {
}); });
schema.statics.findByCredentials = async (email, password) => { schema.statics.findByCredentials = async (email, password) => {
const user = await Users.findOne({ email }); const user = await model.findOne({ email });
if (!user) { if (!user) {
throw new Error('Unable to login'); throw new Error('Unable to login');
...@@ -84,7 +84,7 @@ schema.methods.toJSON = function () { ...@@ -84,7 +84,7 @@ schema.methods.toJSON = function () {
delete publicUserData.tokens; delete publicUserData.tokens;
return publicUserData return publicUserData
} };
const model = mongoose.model( 'Users', schema ); const model = mongoose.model( 'Users', schema );
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment