Module: routes/v1/utils

Provides functions that are used in API and auth.

Source:

Methods

(static) generateAccessToken(user) → {Object}

Generates a new access token for the given user.

Parameters:
Name Type Description
user User
Source:
See:
Returns:
Type
Object

(static) generateGameToken(user) → {Object}

Generates a new game token for the given user.

Parameters:
Name Type Description
user User
Source:
See:
Returns:
Type
Object

Type Definitions

TokenPayload

Body of a token generated by this backend.

Type:
  • Object
Properties:
Name Type Description
expires number

when does the token expire

userId string

what is the user's id

type string

type of the token.

Source: