Skip to content

Conversation

@HrithikMittal
Copy link
Contributor

This pull request is to provide the signup method in the authentication-jwt So it would be easier for developers.
https://github.com/strongloop/loopback-next/blob/master/extensions/authentication-jwt/src/__tests__/fixtures/controllers/user.controller.ts

Fixes #5312

Checklist

👉 Read and sign the CLA (Contributor License Agreement) 👈

  • npm test passes on your machine
  • New tests added or existing tests modified to cover all changes
  • Code conforms with the style guide
  • API Documentation in code was updated
  • Documentation in /docs/site was updated
  • Affected artifact templates in packages/cli were updated
  • Affected example projects in examples/* were updated

👉 Check out how to submit a PR 👈

Copy link
Contributor

@madaky madaky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@HrithikMittal : can you perform npm test on local to check for the issue. There is a step by step tutorial on how to contribute a code change :
https://loopback.io/doc/en/lb4/submitting_a_pr.html

@requestBody({
content: {
'application/json': {
schema: getModelSchemaRef(NewUserRequest, {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No definition for NewUserRequest

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

newUserRequest: NewUserRequest,
): Promise<User> {
const password = await hash(newUserRequest.password, await genSalt());
const savedUser = await this.userRepository.create(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will throw a property does not exist. as no dependency injection.

})
newUserRequest: NewUserRequest,
): Promise<User> {
const password = await hash(newUserRequest.password, await genSalt());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No definition for hash and gen salt

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

@jannyHou jannyHou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@HrithikMittal Thank you for taking care of the improvement 👍
And thanks for @madaky and @dougal83 's review! Please fix the imports, otherwise LGTM.

@requestBody({
content: {
'application/json': {
schema: getModelSchemaRef(NewUserRequest, {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

})
newUserRequest: NewUserRequest,
): Promise<User> {
const password = await hash(newUserRequest.password, await genSalt());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@HrithikMittal
Copy link
Contributor Author

Hi, Everyone Sorry to create an another pull request for this but I do the changes there and also test it in my local laptop. I think it would work Please look at this #5763
and Now I am closing this PR.
Thank you everyone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add "signup" / create user in authentication-jwt module

5 participants