This repository has been archived on 2023-05-17. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
mifi 32bfbd7adc
All checks were successful
continuous-integration/drone/push Build is passing
Finishing touches to publish
2023-05-03 11:38:41 -04:00

18 lines
465 B
TypeScript

// eslint-disable-next-line import/named
import { Strategy as LocalStrategy } from 'passport-local';
import Auth from '../../../db/model/auth';
export default new LocalStrategy(async (username: string, password: string, done: any) => {
const user = await Auth.findOne({
where: {
username,
},
}).catch();
if (user && user.authenticate(password)) {
done(null, user);
} else {
done(null, false);
}
});