import { Principal , securityId , UserProfile } from '@loopback/security' ; param user export function createPrincipalFromUserProfile ( user ) { return { ... user , name : user . name ?? user [ securityId ] , type : 'USER' , } ; }