Api: rotacja refresh tokenu + limit na /auth/refresh, dokumentacja i localhost CORS tylko poza produkcja
This commit is contained in:
@@ -101,6 +101,10 @@ describe('auth routes', () => {
|
||||
const refresh = await agent.post('/api/v1/auth/refresh');
|
||||
expect(refresh.status).toBe(200);
|
||||
expect(typeof refresh.body.accessToken).toBe('string');
|
||||
// rotacja: każde odświeżenie wystawia nowy refresh token w cookie httpOnly
|
||||
const setCookie = (refresh.headers['set-cookie'] ?? []).join('; ');
|
||||
expect(setCookie).toContain('fitos_refresh=');
|
||||
expect(setCookie).toContain('HttpOnly');
|
||||
});
|
||||
|
||||
it('refresh: rejects a missing cookie with 401', async () => {
|
||||
|
||||
Reference in New Issue
Block a user