mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-05 03:19:52 +08:00
Merge remote-tracking branch 'origin/beta' into stable
This commit is contained in:
@@ -226,6 +226,10 @@ export class AuthService implements OnApplicationBootstrap {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async getSession(token: string) {
|
async getSession(token: string) {
|
||||||
|
if (!token) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
return this.db.$transaction(async tx => {
|
return this.db.$transaction(async tx => {
|
||||||
const session = await tx.session.findUnique({
|
const session = await tx.session.findUnique({
|
||||||
where: {
|
where: {
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ import { EventEmitter2 } from '@nestjs/event-emitter';
|
|||||||
import type { Request } from 'express';
|
import type { Request } from 'express';
|
||||||
import Stripe from 'stripe';
|
import Stripe from 'stripe';
|
||||||
|
|
||||||
|
import { Public } from '../../core/auth';
|
||||||
import { Config } from '../../fundamentals';
|
import { Config } from '../../fundamentals';
|
||||||
|
|
||||||
@Controller('/api/stripe')
|
@Controller('/api/stripe')
|
||||||
@@ -28,6 +29,7 @@ export class StripeWebhook {
|
|||||||
this.webhookKey = config.plugins.payment.stripe.keys.webhookKey;
|
this.webhookKey = config.plugins.payment.stripe.keys.webhookKey;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Public()
|
||||||
@Post('/webhook')
|
@Post('/webhook')
|
||||||
async handleWebhook(@Req() req: RawBodyRequest<Request>) {
|
async handleWebhook(@Req() req: RawBodyRequest<Request>) {
|
||||||
// Check if webhook signing is configured.
|
// Check if webhook signing is configured.
|
||||||
|
|||||||
Reference in New Issue
Block a user