mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-12 04:18:54 +00:00
chore(server): clean up throttler (#6326)
This commit is contained in:
@@ -10,13 +10,13 @@ import {
|
||||
import type { UserType } from '../../src/core/user';
|
||||
import { gql } from './common';
|
||||
|
||||
export function sessionCookie(headers: any) {
|
||||
export function sessionCookie(headers: any): string {
|
||||
const cookie = headers['set-cookie']?.find((c: string) =>
|
||||
c.startsWith(`${AuthService.sessionCookieName}=`)
|
||||
);
|
||||
|
||||
if (!cookie) {
|
||||
return null;
|
||||
return '';
|
||||
}
|
||||
|
||||
return cookie.split(';')[0];
|
||||
@@ -29,7 +29,7 @@ export async function getSession(
|
||||
const cookie = sessionCookie(signInRes.headers);
|
||||
const res = await request(app.getHttpServer())
|
||||
.get('/api/auth/session')
|
||||
.set('cookie', cookie)
|
||||
.set('cookie', cookie!)
|
||||
.expect(200);
|
||||
|
||||
return res.body;
|
||||
|
||||
Reference in New Issue
Block a user