Skip to content

📈 Open source, privacy-first web analytics — a cookie-less Google Analytics alternative with built-in error tracking and performance monitoring. Self-host it or use our cloud. Get started for free!

added link / unlink google account controllers

Blue Mouse379a9fcd2e28
diff --git a/src/auth/auth.controller.ts b/src/auth/auth.controller.ts
index 554b9545e..e6c973418 100644
--- a/src/auth/auth.controller.ts
+++ b/src/auth/auth.controller.ts
@@ -438,9 +438,12 @@ export class AuthController {
@Roles(UserType.CUSTOMER, UserType.ADMIN)
@Post('google/link')
public async linkGoogleToAccount(
+ @Body() body: AuthUserGoogleDto,
@CurrentUserId() userId: string,
): Promise<void> {
- // TODO
+ const { token } = body
+
+ await this.authService.linkGoogleAccount(userId, token)
}
@ApiOperation({ summary: 'Unlink Google from an existing account' })
@@ -453,6 +456,6 @@ export class AuthController {
public async unlinkGoogleFromAccount(
@CurrentUserId() userId: string,
): Promise<void> {
- // TODO
+ await this.authService.unlinkGoogleAccount(userId)
}
}