mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-08-24 00:00:46 +00:00
fix(frontend): hand a failed Supabase leg back to the page holding its run
Denial, a token error and a malformed callback all sent the user to /resources whether or not a run was parked. Nothing else consumes the park, so the run stayed in sessionStorage and sprang the wizard open on an unrelated later visit instead. A parked run now lands on the data tables tab, where the wizard resumes on the setup step and can authorize again. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -28,11 +28,20 @@
|
||||
return true
|
||||
}
|
||||
|
||||
/**
|
||||
* Where a failed leg lands when this is not a popup. A parked run has to be handed back its
|
||||
* own page: nothing else consumes the park, so sending it to `/resources` leaves the run in
|
||||
* `sessionStorage` to spring the wizard open on some unrelated later visit.
|
||||
*/
|
||||
function failureDestination(): string {
|
||||
return hasParkedWizard() ? '/workspace_settings?tab=windmill_data_tables' : '/resources'
|
||||
}
|
||||
|
||||
onMount(async () => {
|
||||
if (error) {
|
||||
if (closeIfPopup()) return
|
||||
sendUserToast(`Error trying to fetch projects from windmill: ${error}`, true)
|
||||
goto('/resources')
|
||||
goto(failureDestination())
|
||||
} else if (code && state) {
|
||||
try {
|
||||
const res = await OauthService.connectCallback({
|
||||
@@ -58,12 +67,12 @@
|
||||
} catch (e) {
|
||||
if (closeIfPopup()) return
|
||||
sendUserToast(`Error parsing the response token, ${e.body}`, true)
|
||||
goto('/resources')
|
||||
goto(failureDestination())
|
||||
}
|
||||
} else {
|
||||
if (closeIfPopup()) return
|
||||
sendUserToast('Missing code or state as query params', true)
|
||||
goto('/resources')
|
||||
goto(failureDestination())
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user