add project creation and listing
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
import { signInPath } from '../../controller/users.controller';
|
||||
import { signInPath, createPath } from '../../controller/users.controller';
|
||||
import { UNPROTECTED_ROUTES } from '../session.middleware'
|
||||
|
||||
describe('Unprotected Routes', () => {
|
||||
it('check content', () => {
|
||||
expect(UNPROTECTED_ROUTES.sort()).toEqual([signInPath].sort());
|
||||
expect(UNPROTECTED_ROUTES.sort()).toEqual([createPath, signInPath].sort());
|
||||
})
|
||||
})
|
||||
@@ -1,9 +1,9 @@
|
||||
import { Handler, Request, Response } from 'express';
|
||||
import { verify } from 'jsonwebtoken';
|
||||
import { signInPath } from '../controller/users.controller';
|
||||
import { signInPath, createPath } from '../controller/user.controller';
|
||||
import { AuthService } from '../service/auth.service';
|
||||
|
||||
export const UNPROTECTED_ROUTES = [signInPath];
|
||||
export const UNPROTECTED_ROUTES = [signInPath, createPath];
|
||||
|
||||
export const sessionMiddleware: Handler = (req: Request, res: Response, next) => {
|
||||
const token = req.headers['x-access-token'];
|
||||
|
||||
Reference in New Issue
Block a user