chore: Remove old auth cruft
This commit is contained in:
committed by
mrugesh mohapatra
parent
081284c2d3
commit
0c23844793
@ -25,8 +25,6 @@ export function setAccessTokenToResponse(
|
||||
};
|
||||
const jwtAccess = jwt.sign({ accessToken }, jwtSecret);
|
||||
res.cookie(jwtCookieNS, jwtAccess, cookieConfig);
|
||||
res.cookie('access_token', accessToken.id, cookieConfig);
|
||||
res.cookie('userId', accessToken.userId, cookieConfig);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -121,8 +121,7 @@ describe('getSetAccessToken', () => {
|
||||
});
|
||||
|
||||
describe('setAccessTokenToResponse', () => {
|
||||
it('sets three cookies in the response', () => {
|
||||
expect.assertions(3);
|
||||
it('sets a jwt access token cookie in the response', () => {
|
||||
const req = mockReq();
|
||||
const res = mockRes();
|
||||
|
||||
@ -139,24 +138,6 @@ describe('getSetAccessToken', () => {
|
||||
maxAge: accessToken.ttl
|
||||
}
|
||||
]);
|
||||
expect(res.cookie.getCall(1).args).toEqual([
|
||||
'access_token',
|
||||
accessToken.id,
|
||||
{
|
||||
signed: false,
|
||||
domain: 'localhost',
|
||||
maxAge: accessToken.ttl
|
||||
}
|
||||
]);
|
||||
expect(res.cookie.getCall(2).args).toEqual([
|
||||
'userId',
|
||||
accessToken.userId,
|
||||
{
|
||||
signed: false,
|
||||
domain: 'localhost',
|
||||
maxAge: accessToken.ttl
|
||||
}
|
||||
]);
|
||||
});
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user