import { Router } from "express" ; import { db } from "../db" ; import { auth , verified , pwdConfirmed } from "../middleware" ; const router = Router ( ) ; router . get ( "/" , ( req , res ) => res . json ( { message : "OK" } ) ) ; router . get ( "/me" , auth , ( req , res ) => { return res . json ( db . users . find ( ( user ) => user . id === req . session . userId ) ) ; } ) ; router . get ( "/me/verified" , auth , verified , ( req , res ) => res . json ( { message : "OK" } ) ) ; router . get ( "/me/confirmed" , auth , pwdConfirmed , ( req , res ) => res . json ( { message : "OK" } ) ) ; export { router as demo } ;