Visit another member's profile


#1

Hello,

How can I visit another member’s profile?

This code allows us to see our own profile, but not that of another:

show ({ auth, params }) {
    if (auth.user.id !== Number(params.id)) {
      return "You cannot see someone else's profile"
    }
    return auth.user
}

Thanks


#2
show ({ params }) {
    let user = await User.find(params.id)
    return user
}