Skip to content

Achen 237 google calendar permission request#262

Open
aizilerts wants to merge 23 commits intomainfrom
achen-237-google-calendar-permission-request
Open

Achen 237 google calendar permission request#262
aizilerts wants to merge 23 commits intomainfrom
achen-237-google-calendar-permission-request

Conversation

@aizilerts
Copy link
Copy Markdown
Contributor

** This is a small fix for my previous pr!
On deployment, using Nextjs router was causing an error, so a person in the case 2 userflow (see other pr) would be stuck in a loop trying to access gcal events.

@alexanderl19 alexanderl19 force-pushed the achen-237-google-calendar-permission-request branch from a678386 to f045efc Compare January 18, 2026 21:31
@alexanderl19 alexanderl19 force-pushed the achen-237-google-calendar-permission-request branch from ad78590 to f045efc Compare January 18, 2026 21:36
@KevinWu098
Copy link
Copy Markdown
Member

Where are we with this?

Copy link
Copy Markdown
Member

@KevinWu098 KevinWu098 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Definitely works on staging! I have a few comments though about comments (no pun intended) in this PR

Comment on lines +130 to +131
cookieStore.delete("session");
cookieStore.delete({ name: "session", path: "/" });
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue: why are we deleting the same cookies twice?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Originally I had both of these just to make sure the cookies were being deleted, as I was having issues with that. I looked at the session token cookie function again and I believe we only need the second one, so I deleted the first

Comment thread src/app/auth/login/google/callback/route.tsx
Comment on lines +135 to +137
cookieStore.delete("oauth_state");
cookieStore.delete("oauth_code_verifier");
cookieStore.delete("auth_redirect_url");
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question: why are we only deleting these inside of this code path, instead of always?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right, the cookies should also be deleted for the new user branch. I added the same deletions into that branch

const [googleCalendarEvents, setGoogleCalendarEvents] = useState<
GoogleCalendarEvent[]
>([]);
// const [hasFetchedCalendar, setHasFetchedCalendar] = useState(false);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: comment

Comment thread src/components/availability/availability.tsx Outdated
overlayGoogleCalendar,
availabilityDates,
anchorNormalizedDate,
// hasFetchedCalendar,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit

return;
}
setGoogleCalendarEvents(result.events);
// setHasFetchedCalendar(true);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question: what did/does this do?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This loads the google calendar events after the user has been authenticated/given permissions

fromTime={fromTimeMinutes}
members={members}
timezone={userTimezone}
// timezone={userTimezone}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question: why do we not care about timezone anymore?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pretty sure I commented this out back then to keep congruent with the GroupResponses type, but this is outdated, and I've uncommented it now

doesntNeedDay,
}: GroupResponsesProps) {
const [_newBlocks, newAvailDates] = newZonedPageAvailAndDates(
const [_newBlocks, _newAvailDates] = newZonedPageAvailAndDates(
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue: the underscore implies we're not going to use this value, but we clearly do. can we elaborate on what's going on here

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure exactly why I used an underscore here either (i think i had been going insane) but I've removed it now

Comment thread src/proxy.ts
@@ -4,48 +4,48 @@ import { NextResponse } from "next/server";
export async function proxy(request: NextRequest): Promise<NextResponse> {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue: why have we uncommented all of proxy.ts (fka middleware.ts)?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Originally I commented it because it was interfering with authentication and this was a quick fix. I've put in an if statement that does the same thing and uncommented the rest of proxy.ts

@KevinWu098
Copy link
Copy Markdown
Member

How is progress here?

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 5 files (changes from recent commits).

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="src/app/auth/login/google/callback/route.tsx">

<violation number="1" location="src/app/auth/login/google/callback/route.tsx:25">
P1: Remove sensitive OAuth/cookie debug logs; they expose authentication material in server logs.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

Comment thread src/app/auth/login/google/callback/route.tsx Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants