mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-13 04:48:53 +00:00
fix: use database session cookie for production (#4200)
This commit is contained in:
@@ -251,4 +251,17 @@ export class AuthService {
|
||||
async sendChangeEmail(email: string, callbackUrl: string) {
|
||||
return this.mailer.sendChangeEmail(email, callbackUrl);
|
||||
}
|
||||
async getSessionToken(userId: string) {
|
||||
const session = await this.prisma.session.findFirst({
|
||||
where: {
|
||||
userId: userId,
|
||||
},
|
||||
});
|
||||
|
||||
if (!session) {
|
||||
throw new BadRequestException(`No session found for user id ${userId}`);
|
||||
}
|
||||
|
||||
return session?.sessionToken;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user