UNPKG
@feqra/voucher-pool-common
Version:
latest (1.0.0)
1.0.0
Common library used to handle common errors for a voucher pool system generation.
@feqra/voucher-pool-common
/
build
/
middlewares
/
require-auth.js
10 lines
(9 loc)
•
311 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
"use strict"
;
Object
.
defineProperty
(
exports
,
"__esModule"
, {
value
:
true
});
var
not_authorized_error_1 =
require
(
"../errors/not-authorized-error"
);
exports
.
requireAuth
=
function
(
req, res, next
) {
if
(!req.
currentUser
) {
throw
new
not_authorized_error_1.
NotAuthorizedError
(); }
next
(); };