forked from fr/deguapp
Added: api auth status
This commit is contained in:
parent
de8ff025fa
commit
cdc5970b3a
@ -2,38 +2,13 @@ import { Router } from "express";
|
||||
import * as authController from "../controllers/authController";
|
||||
import validate from '../middlewares/validateRequest'
|
||||
import * as AuthVal from '../validators/authValidator'
|
||||
//import handleValidation from "../middlewares/handleValidation";
|
||||
import { requireAuth } from "../middlewares/authMiddleware";
|
||||
|
||||
const router = Router();
|
||||
|
||||
//const mws = [requireAuth, handleValidation.handleValidationError];
|
||||
|
||||
router.post("/auth/signup",validate(AuthVal.signup) , authController.signup_post);
|
||||
router.post("/auth/signin",validate(AuthVal.signin) , authController.signin_post);
|
||||
router.post("/auth/logout", requireAuth, authController.logout_post);
|
||||
router.get("/auth/status", requireAuth, authController.status_get);
|
||||
|
||||
//router.post(
|
||||
// "/login",
|
||||
// authValidator.checkUserLogin(),
|
||||
// handleValidation.handleValidationError,
|
||||
// userController.login_post
|
||||
//);
|
||||
|
||||
//router.post(
|
||||
// "/register",
|
||||
// authValidator.checkUserRegister(),
|
||||
// handleValidation.handleValidationError,
|
||||
// userController.register_post
|
||||
//);
|
||||
|
||||
//router.post("/logout", userController.logout_post);
|
||||
|
||||
//router.post(
|
||||
// "/edit",
|
||||
// [requireAuth],
|
||||
// authValidator.checkChange(),
|
||||
// userController.edit_post
|
||||
//);
|
||||
|
||||
export default router;
|
||||
export default router;
|
@ -207,7 +207,6 @@ describe('POST /api/v1/auth/logout', () => {
|
||||
});
|
||||
});
|
||||
|
||||
/*
|
||||
describe('GET /api/v1/auth/status', () => {
|
||||
const url = '/api/v1/auth/status';
|
||||
test('should return login status 401', async () => {
|
||||
@ -219,5 +218,4 @@ describe('GET /api/v1/auth/status', () => {
|
||||
const res = await request.get(url).set('Cookie', jwt).send();
|
||||
expect(res.statusCode).toBe(200);
|
||||
});
|
||||
});
|
||||
*/
|
||||
});
|
Loading…
Reference in New Issue
Block a user