How to use the UNAUTHORIZED function from http-status-codes

Find comprehensive JavaScript http-status-codes.UNAUTHORIZED code examples handpicked from public code repositorys.

1
2
3
4
5
6
7
8
9
10
11
12
const StatusCodes = require('http-status-codes');


class UnauthenticatedError extends CustomApiError {
  constructor(message){
    super(message);
    this.statusCode = StatusCodes.UNAUTHORIZED;
  }
}


module.exports = UnauthenticatedError;
fork icon0
star icon0
watch icon0