day len server theo loi Khoi noi, toi xin tuyen bo mien tru trach nhiem

This commit is contained in:
2024-11-05 15:02:53 +07:00
parent 0f68b51d75
commit 56ba2808c8
22 changed files with 482 additions and 63 deletions

View File

@@ -43,7 +43,7 @@ export type SchemaContext =
http: {
req: Request
res: Response
me: User
me: User | null
pubSub: PubSub
invalidateCache: () => Promise<void>
generator: PrismaCrudGenerator<BuilderTypes>

View File

@@ -30,6 +30,10 @@ export class GraphqlService {
if (disableAuth) {
return null
}
// check if the sessionId is valid
if (!sessionId) {
return null
}
// redis context cache
const cachedUser = await this.redis.getUser(sessionId)
if (cachedUser) {