mirror of
https://github.com/plankanban/planka.git
synced 2025-07-24 15:49:46 +02:00
Add email and password change functionality for a current user, remove deep compare hooks
This commit is contained in:
parent
e564729598
commit
2566ff376e
67 changed files with 1232 additions and 267 deletions
36
server/api/responses/forbidden.js
Normal file
36
server/api/responses/forbidden.js
Normal file
|
@ -0,0 +1,36 @@
|
|||
/**
|
||||
* forbidden.js
|
||||
*
|
||||
* A custom response.
|
||||
*
|
||||
* Example usage:
|
||||
* ```
|
||||
* return res.forbidden();
|
||||
* // -or-
|
||||
* return res.forbidden(optionalData);
|
||||
* ```
|
||||
*
|
||||
* Or with actions2:
|
||||
* ```
|
||||
* exits: {
|
||||
* somethingHappened: {
|
||||
* responseType: 'forbidden'
|
||||
* }
|
||||
* }
|
||||
* ```
|
||||
*
|
||||
* ```
|
||||
* throw 'somethingHappened';
|
||||
* // -or-
|
||||
* throw { somethingHappened: optionalData }
|
||||
* ```
|
||||
*/
|
||||
|
||||
module.exports = function forbidden(message) {
|
||||
const { res } = this;
|
||||
|
||||
return res.status(403).json({
|
||||
code: 'E_FORBIDDEN',
|
||||
message
|
||||
});
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue