question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to hide some fields like password?

See original GitHub issue

How to return a custom model? For example, hide password or whatever i want and return response?

@Crud({
  model: {
    type: User,
  },
  routes: {
    getManyBase: {
      decorators: [
        UseGuards(AuthGuard()),
      ],
    },
  },
})
@Controller('users')

When i call the endpoint like GET /users it returns me something like this:

[
    {
        "id": 1,
        "email": "erik.hac@outlook.com",
        "password": "43587y34t9078eryht457089649",
        "isActive": true,
        "isEmailConfirmed": true,
        "createdAt": "2019-07-16T03:05:50.020Z",
        "updatedAt": "2019-07-19T21:11:16.032Z",
        "lastSession": "2019-07-19T21:11:16.007Z",
        "resetPasswordExpire": null,
        "resetPasswordToken": null
    }
]

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:14 (7 by maintainers)

github_iconTop GitHub Comments

3reactions
michaelyalicommented, Jul 20, 2019

You can use exclude in the CrudOptions

2reactions
michaelyalicommented, Oct 12, 2019

@eranshmil I’m going to publish RC version today probably. Will let you know 😉

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cleanest way to hide password input fields? - Stack Overflow
The cleanest way is to check the type attribute of the input element. The HTML5 specification has this to say about input type=password...
Read more >
How to hide input similar to Password field - Jotform
You must be looking for a way to masked the text with asterisk (*) similar to that of a password. You can achieve...
Read more >
How to Hide Password in HTML ? - GeeksforGeeks
Hiding the password is commonly known as Password Masking. It is hiding the password characters when entered by the users by the use...
Read more >
How to Use Password Fields and Hidden Fields in Your ...
Use the element with its type attribute set to hidden. 2.Supply the name and value pair you want to send to the form...
Read more >
Hide/unhide field based on password in a text fiel...
Hi, I'm sure this is probably a really easy one, but I'm a newbie to javascript... What I'd like to achieve is to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found