In a mongoose schema I'd like to check if a user my save a file. Using everyauth I've got it to work, but it throws an error with the full stacktrace into the console.
SpotSchema.pre('save', function (next) {
if(!everyauth.user){
// throws the errror
next(new Error('Not Logged in'));
return;
}
next();
}
Is there a way to handle this more gracefully?