mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-18 18:46:19 +08:00
test(server): avoid progress get hold after tests finished (#5522)
This commit is contained in:
@@ -167,8 +167,13 @@ export class AuthResolver {
|
||||
@CurrentUser() user: UserType,
|
||||
@Args('token') token: string
|
||||
) {
|
||||
const key = await this.session.get(token);
|
||||
if (!key) {
|
||||
throw new ForbiddenException('Invalid token');
|
||||
}
|
||||
|
||||
// email has set token in `sendVerifyChangeEmail`
|
||||
const [id, email] = (await this.session.get(token)).split(',');
|
||||
const [id, email] = key.split(',');
|
||||
if (!id || id !== user.id || !email) {
|
||||
throw new ForbiddenException('Invalid token');
|
||||
}
|
||||
|
||||
@@ -6,18 +6,8 @@ import { ServerOptions } from 'socket.io';
|
||||
export class RedisIoAdapter extends IoAdapter {
|
||||
private adapterConstructor: ReturnType<typeof createAdapter> | undefined;
|
||||
|
||||
async connectToRedis(
|
||||
host: string,
|
||||
port: number,
|
||||
username: string,
|
||||
password: string,
|
||||
db: number
|
||||
): Promise<void> {
|
||||
const pubClient = new Redis(port, host, {
|
||||
username,
|
||||
password,
|
||||
db,
|
||||
});
|
||||
async connectToRedis(redis: Redis): Promise<void> {
|
||||
const pubClient = redis;
|
||||
pubClient.on('error', err => {
|
||||
console.error(err);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user