import { Request , Response } from 'express' ; import { authenticate } from "./db-data" ; export function loginUser ( req , res ) { console . log ( "User login attempt ..." ) ; const { email , password } = req . body ; const user = authenticate ( email , password ) ; if ( user ) { res . status ( 200 ) . json ( { email : user . email } ) ; } else { res . sendStatus ( 403 ) ; } }