Fix for staging environment variable API endpoints

Ugly but effective fix for the fact we can pass the slug in as “staging” when we use “stg” internally
This commit is contained in:
Matt Aitken
2024-07-15 16:33:00 +01:00
parent 76a15fd278
commit ec8381e2d0
@@ -153,6 +153,10 @@ export async function authenticatedEnvironmentForAuthentication(
projectRef: string,
slug: string
): Promise<AuthenticatedEnvironment> {
if (slug === "staging") {
slug = "stg";
}
switch (auth.type) {
case "apiKey": {
if (auth.result.environment.project.externalRef !== projectRef) {