import { LoginRequest , LoginResponse } from '@appkit-common/model/auth' ; import * as authUtil from '@appkit-server/util/auth' ; import { config } from '@server/config/config' ; import { Express } from 'express' ; export function makeRoutes ( app ) { app . post ( '/auth/login' , async ( req , res ) => { const reqBody = req . body as LoginRequest ; const token = authUtil . signJwt ( { userName : reqBody . credentials . userName } , config . authSecretKey ) ; const loginResponse = { succeeded : true , token : token , user : { userName : reqBody . credentials . userName , email : '' , firstName : '' , lastName : '' } , serverVersion : config . version } ; res . json ( loginResponse ) ; } ) ; }