triggerdotdev / trigger.dev

Trigger.dev is the open source background jobs platform for TypeScript.

Home Page:https://trigger.dev/changelog

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

bug: Supabase integration does not work with custom domains

kylewill opened this issue · comments

Provide environment information

Problem: If a user has a custom domain and adds that to their environment variables Trigger.dev is not able to use the Supabase Management API.

The issue seems to be trigger is using the URL from the config (expecting {project-id}.supabase.co format).

But if it's a custom domain trigger extracts the subdomain and uses that as the project id.

Reproduction

Add a custom domain in a supabase project

Add the custom domain to the .env

Note how triggers are not created and received a 403 error.

Workaround

The user must use the {project-id}.supabase.co format in their environment.

I do not know if there are other issues with doing this yet but suspect so.

Suggested fix

If the supabase url is not in the {project-id}.supabase.co format, do an nslookup to see where it redirects and get the project-id.

Describe the bug

Problem: If a user has a custom domain and adds that to their environment variables Trigger.dev is not able to use the Supabase Management API.

The issue seems to be trigger is using the URL from the config (expecting {project-id}.supabase.co format).

But if it's a custom domain trigger extracts the subdomain and uses that as the project id.

Reproduction repo

n/a described below

To reproduce

Reproduction

Add a custom domain in a supabase project

Add the custom domain to the .env

Note how triggers are not created and received a 403 error.

Workaround

The user must use the {project-id}.supabase.co format in their environment.

I do not know if there are other issues with doing this yet but suspect so.

Additional information

Workaround

The user must use the {project-id}.supabase.co format in their environment.

I do not know if there are other issues with doing this yet but suspect so.

Suggested fix

If the supabase url is not in the {project-id}.supabase.co format, do an nslookup to see where it redirects and get the project-id.