Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(automate): redirect github auth flow to workspace if possible #3632

Merged
merged 7 commits into from
Dec 6, 2024

Conversation

cdriesler
Copy link
Member

Description & motivation

  • The GitHub app auth flow currently redirects to /functions in all cases
  • This is jarring (and, right now, incorrect) because it subtly rips people out of the "make function in workspace flow"

Changes:

  • Stores workspaceSlug in request session if available
  • Redirects to /workspaces/:slug/functions at end if value is available (preserving the private function creation flow)

Validated with a personal github app locally, may be difficult to test (can help)

iainsproat
iainsproat previously approved these changes Dec 4, 2024
Copy link
Contributor

@iainsproat iainsproat left a comment

Choose a reason for hiding this comment

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

seems legit, please have a frontend engineer review too

@cdriesler cdriesler requested review from Mikehrn and andrewwallacespeckle and removed request for gjedlicska December 4, 2024 16:54
@@ -77,7 +80,7 @@ const props = defineProps<{
isAuthorized: boolean
templates: CreatableFunctionTemplate[]
githubOrgs: string[]
workspaceId?: string
workspace?: Pick<Workspace, 'id' | 'slug'>
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

roger, done

@cdriesler cdriesler requested a review from fabis94 December 5, 2024 16:56
fabis94
fabis94 previously approved these changes Dec 5, 2024
Copy link
Contributor

@fabis94 fabis94 left a comment

Choose a reason for hiding this comment

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

nearly there

import type { AutomateFunctionEditDialog_WorkspaceFragment } from '~/lib/common/generated/gql/graphql'

graphql(`
fragment AutomateFunctionEditDialog_Workspace on Workspace {
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't see this one used in other fragments or queries

Copy link
Member Author

Choose a reason for hiding this comment

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

updated 👍

@cdriesler cdriesler merged commit 02be49f into main Dec 6, 2024
26 of 28 checks passed
@cdriesler cdriesler deleted the charles/authorizeAppRedirect branch December 6, 2024 08:24
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