We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
@bajtos
import {Entity, model, property} from '@loopback/repository'; const crypto = require('crypto'); @model() export class User extends Entity{ [...] @property({ type: 'string', required: false }) private hashedPassword: string; @property({ type: 'string' }) private salt: string; set password(password: string){ if(!this.salt || !this.salt.length){ this.salt = crypto.randomBytes(32).toString('hex'); } this.hashedPassword = this.encryptPassword(password); } private encryptPassword(password: string) { return crypto.pbkdf2Sync(password, this.salt, 10000, 512, 'sha512').toString('hex'); }; public checkPassword(password: string) { return this.encryptPassword(password) === this.hashedPassword; }; }
@AfterLoad @BeforeInsert @AfterInsert @BeforeUpdate @AfterUpdate @BeforeRemove @AfterRemove
The text was updated successfully, but these errors were encountered:
I am not sure what exactly are you asking for.
Is loopback4 support TYPEORM?.
LoopBack 4 can be used together with TypeORM, see https://github.com/raymondfeng/loopback4-extension-repository-typeorm
How do I use @BeforeInsert TYPEORM in the schema?
Our persistence layer @loopback/repository does not support before/after hooks yet, see the discussion in #1919 for more details.
Sorry, something went wrong.
Any example with loopback3 and typeorm? I write this example, but i dont if is the correct.way. https://medium.com/@davidgarciasantes/typeorm-with-loopback-3-68b195cbe6de
bajtos
No branches or pull requests
@bajtos
How do I use @BeforeInsert TYPEORM in the schema?
Is loopback4 support TYPEORM?.
@AfterLoad
@BeforeInsert
@AfterInsert
@BeforeUpdate
@AfterUpdate
@BeforeRemove
@AfterRemove
The text was updated successfully, but these errors were encountered: