The leaderboard-api authentication controller module.
- Version:
- 1.0.0
- Source:
Methods
(async, static) createUserMiddleware(req, res) → {Promise}
Router-level middleware function to create a nonexistent user and responds with JWT token.
Parameters:
Name | Type | Description |
---|---|---|
req |
object | The request object. |
res |
object | The response object. |
- Source:
Requires:
- module:redis-users.Users.createUser
Returns:
- Type
- Promise
(async, static) deleteUserMiddleware(req, res) → {Promise}
Router-level middleware function to delete an existing user.
Parameters:
Name | Type | Description |
---|---|---|
req |
object | The request object. |
res |
object | The response object. |
- Source:
Requires:
- module:redis-users.Users.deleteUser
- module:redis-leaderboard.LeaderBoard.removeUserScore
Returns:
- Type
- Promise
(async, static) getUsersMiddleware(req, res) → {Promise}
Router-level middleware function to get all users.
Parameters:
Name | Type | Description |
---|---|---|
req |
object | The request object. |
res |
object | The response object. |
- Source:
Requires:
- module:redis-users.Users.getUsers
Returns:
- Type
- Promise
(async, static) updateUserMiddleware(req, res) → {Promise}
Router-level middleware function to update an existing user and responds with JWT token.
Parameters:
Name | Type | Description |
---|---|---|
req |
object | The request object. |
res |
object | The response object. |
- Source:
Requires:
- module:redis-users.Users.updateUser
Returns:
- Type
- Promise
(inner) verifyCredentials(req, res) → {boolean}
Verifies the user credentials and sends non OK response otherwise.
Parameters:
Name | Type | Description |
---|---|---|
req |
object | The request object. |
res |
object | The response object. |
- Source:
Returns:
True when user credentials are verified, false otherwise.
- Type
- boolean