Merge branch 'main' of github.com:stackframe-projects/stack

This commit is contained in:
Zai Shi 2024-03-06 01:27:49 +08:00
commit a66e32fef7
2 changed files with 5 additions and 4 deletions

View File

@ -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,

View File

@ -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();
}