mirror of
https://github.com/microsoft/TypeScript-Node-Starter.git
synced 2026-03-24 18:01:48 +00:00
Changed function expressions declarations from let to const
Every variable that wouldn't change should be declared as const for safety reasons.
This commit is contained in:
@@ -121,7 +121,7 @@ passport.use(new FacebookStrategy({
|
||||
/**
|
||||
* Login Required middleware.
|
||||
*/
|
||||
export let isAuthenticated = (req: Request, res: Response, next: NextFunction) => {
|
||||
export const isAuthenticated = (req: Request, res: Response, next: NextFunction) => {
|
||||
if (req.isAuthenticated()) {
|
||||
return next();
|
||||
}
|
||||
@@ -131,7 +131,7 @@ export let isAuthenticated = (req: Request, res: Response, next: NextFunction) =
|
||||
/**
|
||||
* Authorization Required middleware.
|
||||
*/
|
||||
export let isAuthorized = (req: Request, res: Response, next: NextFunction) => {
|
||||
export const isAuthorized = (req: Request, res: Response, next: NextFunction) => {
|
||||
const provider = req.path.split("/").slice(-1)[0];
|
||||
|
||||
if (_.find(req.user.tokens, { kind: provider })) {
|
||||
|
||||
Reference in New Issue
Block a user