Skip to content

Get token function #19

@RobertIndie

Description

@RobertIndie

This function is responsible for validating the user name and password. It will return a token to the user.
Input event is as below:

{
    "userName": "user-a",
    "password": "pwd"
}

Output event is as below:

{
    "token": "xxx"
}

This function should only care about the fields that need to be cared about and should not change fields that are not related to it.
For example, when the input is :

{
    "requestId": "1",
    "userName": "user-a",
    "password": "pwd"
}

It should output the event as below:

{
    "requestId": "1",
    "token": "xxx"
}

As you can see, it did not change the field requestId.
This function validates the user login information through a database like MySQL.

  • Implement Get Token function
  • Unit tests

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions