diff --git a/packages/stack-server/src/lib/projects.tsx b/packages/stack-server/src/lib/projects.tsx index 967f6b808..445ae44d4 100644 --- a/packages/stack-server/src/lib/projects.tsx +++ b/packages/stack-server/src/lib/projects.tsx @@ -153,7 +153,7 @@ export async function createProject( config: { create: { allowLocalhost: projectOptions.allowLocalhost, - credentialEnabled: projectOptions.credentialEnabled, + enableCredential: projectOptions.credentialEnabled, oauthProviderConfigs: { create: (['github', 'facebook', 'google', 'microsoft'] as const).map((id) => ({ id, @@ -299,7 +299,7 @@ export async function updateProject( // Update credentialEnabled transaction.push(prismaClient.projectConfig.update({ where: { id: project.config.id }, - data: { credentialEnabled: options.config.credentialEnabled }, + data: { enableCredential: options.config.credentialEnabled }, })); } @@ -358,7 +358,7 @@ function projectJsonFromDbType(project: ProjectDB): ProjectJson { evaluatedConfig: { id: project.config.id, allowLocalhost: project.config.allowLocalhost, - credentialEnabled: project.config.credentialEnabled, + credentialEnabled: project.config.enableCredential, domains: project.config.domains.map((domain) => ({ domain: domain.domain, handlerPath: domain.handlerPath, diff --git a/packages/stack-shared/src/interface/clientInterface.ts b/packages/stack-shared/src/interface/clientInterface.ts index 10bed18e3..f74636146 100644 --- a/packages/stack-shared/src/interface/clientInterface.ts +++ b/packages/stack-shared/src/interface/clientInterface.ts @@ -274,7 +274,8 @@ export class StackClientInterface { // TODO this is a hack. Occurs when the admin access token is invalid, or expired. Has plenty of weird side effects so we should replace this if ("internalAdminAccessToken" in this.options && error?.message?.includes?.("Invalid API key") && typeof window !== "undefined") { alert("Your session has expired. The page will now reload." + (process.env.NODE_ENV == "development" ? "\n\nThis is a hack and we should probably fix this at some point." : "")); - window.location.reload(); + window.location.href = "/"; + document.body.innerHTML = "Reloading..."; await neverResolve(); }