fix(server): blob controller permission (#6746)

This commit is contained in:
forehalo
2024-04-30 03:46:59 +00:00
parent 9b28e7313f
commit a14194c482
5 changed files with 295 additions and 9 deletions

View File

@@ -10,6 +10,14 @@ import {
import type { UserType } from '../../src/core/user';
import { gql } from './common';
export async function internalSignIn(app: INestApplication, userId: string) {
const auth = app.get(AuthService);
const session = await auth.createUserSession({ id: userId });
return `${AuthService.sessionCookieName}=${session.sessionId}`;
}
export function sessionCookie(headers: any): string {
const cookie = headers['set-cookie']?.find((c: string) =>
c.startsWith(`${AuthService.sessionCookieName}=`)