Skip to content

Scheduling infrastructure for absolutely everyone.

fix: redirect on calendar oauth denied auth (#18228)

Morgan5fad7c94782e
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 95d7dd7c376..292c611fbd0 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 eeab3027e1a..075f0018f7c 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 };
}