Middleware
- Source:
Methods
(async, inner) isLoggedIn(req, res, next)
Check if the User is Logged in an save it to req.userData
Redirect to the sign-in if the Token is invalid
or if you call the sign-in or sign-up you get redirected
to the /gaming
Parameters:
Name | Type | Description |
---|---|---|
req |
Request | The req object represents the HTTP request and has properties for the request query string, parameters, body, HTTP headers, and so on |
res |
Response | The res object represents the HTTP response that an Express app sends when it gets an HTTP request. |
next |
* | Control to the next handler |
- Source:
Returns:
str JSON with more infos
(inner) validateRegister(req, res, next)
Check if the values from the registration are valid
Parameters:
Name | Type | Description |
---|---|---|
req |
Request | The req object represents the HTTP request and has properties for the request query string, parameters, body, HTTP headers, and so on |
res |
Response | The res object represents the HTTP response that an Express app sends when it gets an HTTP request. |
next |
* | Control to the next handler |
- Source:
Returns:
str JSON with more infos