import { injectable } from "tsyringe" ; import { User } from "../models/user.model" ; @ injectable ( ) export class AuthTokenSerializer { public deserialize ( payload ) { return payload ; } public serialize ( accessToken , refreshToken , user ) { return { accessToken , refreshToken , user : { email : user . email , firstname : user . first_name , id : user . id , lastname : user . last_name , role : user . role , username : user . username } } ; } }