random

Function to generate a random passcode.

random(howMany: number, chars: string): string
Parameters
howMany (number) number of characters in the passcode. Chosen 6 because it seems to be the standard followed by companies like google.
chars (string) the allowed characters in the passcode
Returns
string: The random passcode generated for the user request.

sendMail

This function sends mail to the user informing them of their passcode generated to verify them in database.

sendMail(passcode: string, req: object, res: object)
Parameters
passcode (string)
req (object)
res (object)

post

This is the REST endpoint for the frontend to request the passcode from.

post