From 5fad7c94782ef7fe033fa79a457275554a2c4cfc Mon Sep 17 00:00:00 2001 From: Morgan <33722304+ThyMinimalDev@users.noreply.github.com> Date: Tue, 17 Dec 2024 11:05:10 +0200 Subject: [PATCH] fix: redirect on calendar oauth denied auth (#18228) --- apps/api/v2/src/ee/calendars/services/gcal.service.ts | 2 +- apps/api/v2/src/ee/calendars/services/outlook.service.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/api/v2/src/ee/calendars/services/gcal.service.ts b/apps/api/v2/src/ee/calendars/services/gcal.service.ts index 95d7dd7c37..292c611fbd 100644 --- a/apps/api/v2/src/ee/calendars/services/gcal.service.ts +++ b/apps/api/v2/src/ee/calendars/services/gcal.service.ts @@ -116,7 +116,7 @@ export class GoogleCalendarService implements OAuthCalendarApp { ) { // User chose not to authorize your app or didn't authorize your app // redirect directly without oauth code - if (!code) { + if (!code || code === "undefined") { return { url: redir || origin }; } diff --git a/apps/api/v2/src/ee/calendars/services/outlook.service.ts b/apps/api/v2/src/ee/calendars/services/outlook.service.ts index eeab3027e1..075f0018f7 100644 --- a/apps/api/v2/src/ee/calendars/services/outlook.service.ts +++ b/apps/api/v2/src/ee/calendars/services/outlook.service.ts @@ -151,7 +151,7 @@ export class OutlookService implements OAuthCalendarApp { redir?: string ) { // if code is not defined, user denied to authorize office 365 app, just redirect straight away - if (!code) { + if (!code || code === "undefined") { return { url: redir || origin }; }