Do not log coupon code (#533)

pull/534/head
Thomas Kaul 3 years ago committed by GitHub
parent ebee851b23
commit 11076592d1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -70,7 +70,9 @@ export class SubscriptionController {
value: JSON.stringify(coupons)
});
Logger.log(`Coupon with code '${couponCode}' has been redeemed`);
Logger.log(
`Subscription for user '${this.request.user.id}' has been created with coupon`
);
res.status(StatusCodes.OK);
@ -82,10 +84,12 @@ export class SubscriptionController {
@Get('stripe/callback')
public async stripeCallback(@Req() req, @Res() res) {
await this.subscriptionService.createSubscriptionViaStripe(
const userId = await this.subscriptionService.createSubscriptionViaStripe(
req.query.checkoutSessionId
);
Logger.log(`Subscription for user '${userId}' has been created via Stripe`);
res.redirect(`${this.configurationService.get('ROOT_URL')}/account`);
}

@ -75,8 +75,6 @@ export class SubscriptionService {
}
}
});
Logger.log(`Subscription for user '${aUserId}' has been created`);
}
public async createSubscriptionViaStripe(aCheckoutSessionId: string) {
@ -90,6 +88,8 @@ export class SubscriptionService {
await this.stripe.customers.update(session.customer as string, {
description: session.client_reference_id
});
return session.client_reference_id;
} catch (error) {
Logger.error(error);
}

Loading…
Cancel
Save