Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

Append more info regarding project auth config when submitting support form

Joshen Lima94625254380
diff --git a/studio/pages/support/new.tsx b/studio/pages/support/new.tsx
index 886ffc4a36d..cb10cfb3a6f 100644
--- a/studio/pages/support/new.tsx
+++ b/studio/pages/support/new.tsx
@@ -17,7 +17,7 @@ import { useRouter } from 'next/router'
import { API_URL } from 'lib/constants'
import { useStore, withAuth } from 'hooks'
-import { post } from 'lib/common/fetch'
+import { post, get } from 'lib/common/fetch'
import { Project } from 'types'
import { isUndefined } from 'lodash'
@@ -195,17 +195,32 @@ const SupportNew = () => {
setErrors([...errors])
if (errors.length === 0) {
- setLoading(true)
- const response = await post(`${API_URL}/feedback/send`, {
+ const projectRef = formState.project.value
+ const payload = {
+ projectRef,
message: formState.body.value,
category: formState.category.value,
- projectRef: formState.project.value,
verified: true,
tags: ['dashboard-support-form'],
subject: formState.subject.value,
severity: formState.severity.value,
- })
+ siteUrl: '',
+ additionalRedirectUrls: '',
+ }
+
+ if (projectRef !== 'no-project') {
+ const URL = `${API_URL}/auth/${projectRef}/config`
+ const authConfig = await get(URL)
+ if (!authConfig.error) {
+ payload.siteUrl = authConfig.SITE_URL
+ payload.additionalRedirectUrls = authConfig.URI_ALLOW_LIST
+ }
+ }
+
+ setLoading(true)
+ const response = await post(`${API_URL}/feedback/send`, payload)
setLoading(false)
+
if (response.error) {
ui.setNotification({
category: 'error',