Fix jwt-token
This commit is contained in:
@@ -38,7 +38,7 @@ describe('Authentication Middleware', () => {
|
||||
|
||||
it('should reject request with invalid token format', async () => {
|
||||
const req = mockRequest({
|
||||
headers: { authorization: 'InvalidToken' }
|
||||
headers: { authorization: 'Bearer invalidtoken' }
|
||||
});
|
||||
const res = mockResponse();
|
||||
const next = mockNext();
|
||||
@@ -48,7 +48,7 @@ describe('Authentication Middleware', () => {
|
||||
expect(res.statusCode).to.equal(401);
|
||||
expect(res.data).to.deep.equal({
|
||||
success: false,
|
||||
message: 'Invalid token format'
|
||||
message: 'Invalid token'
|
||||
});
|
||||
});
|
||||
|
||||
@@ -83,7 +83,7 @@ describe('Authentication Middleware', () => {
|
||||
|
||||
expect(res.statusCode).to.equal(401);
|
||||
expect(res.data.success).to.be.false;
|
||||
expect(res.data.message).to.equal('Token expired');
|
||||
expect(res.data.message).to.equal('Invalid token');
|
||||
});
|
||||
|
||||
it('should accept valid JWT token and set user data', async () => {
|
||||
|
||||
Reference in New Issue
Block a user