Skip to content

custom jwt authentication #6858

@webafra

Description

@webafra

Hello.

I want to use this service to develop my own personalized authentication.

  1. Find the user
  2. Create the JWT access token for that user
let findUser = await this.userRepository.findOne({
      where: {
        mobile: credentials.mobile
      },
      order: ["id DESC"]
    });

    const token = await this.jwtService.generateToken(findUser.id);

    return { access_token: token }

The code I wrote does not work because method (generateToken) inputs argument must be an email and a name.
I want to authenticate with a mobile number.

please help me.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions