Merge pull request #4335 from Dokploy/fix/auth-redirect-permanent-cache

fix: use temporary redirects for auth checks in getServerSideProps
This commit is contained in:
Mauricio Siu
2026-04-30 18:47:17 -06:00
committed by GitHub
42 changed files with 68 additions and 68 deletions
+1 -1
View File
@@ -84,7 +84,7 @@ export async function getServerSideProps(ctx: GetServerSidePropsContext) {
if (!user) { if (!user) {
return { return {
redirect: { redirect: {
permanent: true, permanent: false,
destination: "/", destination: "/",
}, },
}; };
+1 -1
View File
@@ -24,7 +24,7 @@ export async function getServerSideProps(ctx: GetServerSidePropsContext) {
if (!user) { if (!user) {
return { return {
redirect: { redirect: {
permanent: true, permanent: false,
destination: "/", destination: "/",
}, },
}; };
+2 -2
View File
@@ -95,7 +95,7 @@ export async function getServerSideProps(
if (IS_CLOUD) { if (IS_CLOUD) {
return { return {
redirect: { redirect: {
permanent: true, permanent: false,
destination: "/dashboard/home", destination: "/dashboard/home",
}, },
}; };
@@ -104,7 +104,7 @@ export async function getServerSideProps(
if (!user) { if (!user) {
return { return {
redirect: { redirect: {
permanent: true, permanent: false,
destination: "/", destination: "/",
}, },
}; };
@@ -1827,7 +1827,7 @@ export async function getServerSideProps(
if (!user) { if (!user) {
return { return {
redirect: { redirect: {
permanent: true, permanent: false,
destination: "/", destination: "/",
}, },
}; };
@@ -451,7 +451,7 @@ export async function getServerSideProps(
if (!user) { if (!user) {
return { return {
redirect: { redirect: {
permanent: true, permanent: false,
destination: "/", destination: "/",
}, },
}; };
@@ -455,7 +455,7 @@ export async function getServerSideProps(
if (!user) { if (!user) {
return { return {
redirect: { redirect: {
permanent: true, permanent: false,
destination: "/", destination: "/",
}, },
}; };
@@ -307,7 +307,7 @@ export async function getServerSideProps(
if (!user) { if (!user) {
return { return {
redirect: { redirect: {
permanent: true, permanent: false,
destination: "/", destination: "/",
}, },
}; };
@@ -336,7 +336,7 @@ export async function getServerSideProps(
if (!user) { if (!user) {
return { return {
redirect: { redirect: {
permanent: true, permanent: false,
destination: "/", destination: "/",
}, },
}; };
@@ -340,7 +340,7 @@ export async function getServerSideProps(
if (!user) { if (!user) {
return { return {
redirect: { redirect: {
permanent: true, permanent: false,
destination: "/", destination: "/",
}, },
}; };
@@ -318,7 +318,7 @@ export async function getServerSideProps(
if (!user) { if (!user) {
return { return {
redirect: { redirect: {
permanent: true, permanent: false,
destination: "/", destination: "/",
}, },
}; };
@@ -324,7 +324,7 @@ export async function getServerSideProps(
if (!user) { if (!user) {
return { return {
redirect: { redirect: {
permanent: true, permanent: false,
destination: "/", destination: "/",
}, },
}; };
@@ -329,7 +329,7 @@ export async function getServerSideProps(
if (!user) { if (!user) {
return { return {
redirect: { redirect: {
permanent: true, permanent: false,
destination: "/", destination: "/",
}, },
}; };
+1 -1
View File
@@ -56,7 +56,7 @@ export async function getServerSideProps(
if (!user) { if (!user) {
return { return {
redirect: { redirect: {
permanent: true, permanent: false,
destination: "/", destination: "/",
}, },
}; };
+2 -2
View File
@@ -17,7 +17,7 @@ export async function getServerSideProps(
if (IS_CLOUD) { if (IS_CLOUD) {
return { return {
redirect: { redirect: {
permanent: true, permanent: false,
destination: "/dashboard/home", destination: "/dashboard/home",
}, },
}; };
@@ -26,7 +26,7 @@ export async function getServerSideProps(
if (!user) { if (!user) {
return { return {
redirect: { redirect: {
permanent: true, permanent: false,
destination: "/", destination: "/",
}, },
}; };
+2 -2
View File
@@ -34,7 +34,7 @@ export async function getServerSideProps(
if (IS_CLOUD) { if (IS_CLOUD) {
return { return {
redirect: { redirect: {
permanent: true, permanent: false,
destination: "/dashboard/home", destination: "/dashboard/home",
}, },
}; };
@@ -43,7 +43,7 @@ export async function getServerSideProps(
if (!user || (user.role !== "owner" && user.role !== "admin")) { if (!user || (user.role !== "owner" && user.role !== "admin")) {
return { return {
redirect: { redirect: {
permanent: true, permanent: false,
destination: "/", destination: "/",
}, },
}; };
+1 -1
View File
@@ -45,7 +45,7 @@ export async function getServerSideProps(
if (!user || user.role === "member") { if (!user || user.role === "member") {
return { return {
redirect: { redirect: {
permanent: true, permanent: false,
destination: "/", destination: "/",
}, },
}; };
@@ -27,7 +27,7 @@ export async function getServerSideProps(ctx: GetServerSidePropsContext) {
if (!user) { if (!user) {
return { return {
redirect: { destination: "/", permanent: true }, redirect: { destination: "/", permanent: false },
}; };
} }
@@ -23,7 +23,7 @@ export async function getServerSideProps(
if (!IS_CLOUD) { if (!IS_CLOUD) {
return { return {
redirect: { redirect: {
permanent: true, permanent: false,
destination: "/dashboard/home", destination: "/dashboard/home",
}, },
}; };
@@ -33,7 +33,7 @@ export async function getServerSideProps(
if (!user || user.role !== "owner") { if (!user || user.role !== "owner") {
return { return {
redirect: { redirect: {
permanent: true, permanent: false,
destination: "/", destination: "/",
}, },
}; };
@@ -28,7 +28,7 @@ export async function getServerSideProps(
if (!user || user.role === "member") { if (!user || user.role === "member") {
return { return {
redirect: { redirect: {
permanent: true, permanent: false,
destination: "/", destination: "/",
}, },
}; };
@@ -27,7 +27,7 @@ export async function getServerSideProps(
if (IS_CLOUD) { if (IS_CLOUD) {
return { return {
redirect: { redirect: {
permanent: true, permanent: false,
destination: "/dashboard/home", destination: "/dashboard/home",
}, },
}; };
@@ -36,7 +36,7 @@ export async function getServerSideProps(
if (!user || user.role === "member") { if (!user || user.role === "member") {
return { return {
redirect: { redirect: {
permanent: true, permanent: false,
destination: "/", destination: "/",
}, },
}; };
@@ -28,7 +28,7 @@ export async function getServerSideProps(
if (!user || user.role === "member") { if (!user || user.role === "member") {
return { return {
redirect: { redirect: {
permanent: true, permanent: false,
destination: "/", destination: "/",
}, },
}; };
@@ -27,7 +27,7 @@ export async function getServerSideProps(
if (!user) { if (!user) {
return { return {
redirect: { redirect: {
permanent: true, permanent: false,
destination: "/", destination: "/",
}, },
}; };
@@ -53,7 +53,7 @@ export async function getServerSideProps(
if (!userPermissions?.gitProviders.read) { if (!userPermissions?.gitProviders.read) {
return { return {
redirect: { redirect: {
permanent: true, permanent: false,
destination: "/", destination: "/",
}, },
}; };
@@ -23,7 +23,7 @@ export async function getServerSideProps(
if (!IS_CLOUD) { if (!IS_CLOUD) {
return { return {
redirect: { redirect: {
permanent: true, permanent: false,
destination: "/dashboard/home", destination: "/dashboard/home",
}, },
}; };
@@ -33,7 +33,7 @@ export async function getServerSideProps(
if (!user || user.role !== "owner") { if (!user || user.role !== "owner") {
return { return {
redirect: { redirect: {
permanent: true, permanent: false,
destination: "/", destination: "/",
}, },
}; };
@@ -38,7 +38,7 @@ export async function getServerSideProps(
if (!user) { if (!user) {
return { return {
redirect: { redirect: {
permanent: true, permanent: false,
destination: "/", destination: "/",
}, },
}; };
@@ -46,7 +46,7 @@ export async function getServerSideProps(
if (user.role !== "owner") { if (user.role !== "owner") {
return { return {
redirect: { redirect: {
permanent: true, permanent: false,
destination: "/dashboard/settings/profile", destination: "/dashboard/settings/profile",
}, },
}; };
@@ -28,7 +28,7 @@ export async function getServerSideProps(
if (!user || user.role === "member") { if (!user || user.role === "member") {
return { return {
redirect: { redirect: {
permanent: true, permanent: false,
destination: "/", destination: "/",
}, },
}; };
@@ -54,7 +54,7 @@ export async function getServerSideProps(
if (!user) { if (!user) {
return { return {
redirect: { redirect: {
permanent: true, permanent: false,
destination: "/", destination: "/",
}, },
}; };
@@ -28,7 +28,7 @@ export async function getServerSideProps(
if (!user || user.role === "member") { if (!user || user.role === "member") {
return { return {
redirect: { redirect: {
permanent: true, permanent: false,
destination: "/", destination: "/",
}, },
}; };
@@ -44,7 +44,7 @@ export async function getServerSideProps(
if (IS_CLOUD) { if (IS_CLOUD) {
return { return {
redirect: { redirect: {
permanent: true, permanent: false,
destination: "/dashboard/home", destination: "/dashboard/home",
}, },
}; };
@@ -53,7 +53,7 @@ export async function getServerSideProps(
if (!user) { if (!user) {
return { return {
redirect: { redirect: {
permanent: true, permanent: false,
destination: "/", destination: "/",
}, },
}; };
@@ -61,7 +61,7 @@ export async function getServerSideProps(
if (user.role === "member") { if (user.role === "member") {
return { return {
redirect: { redirect: {
permanent: true, permanent: false,
destination: "/dashboard/settings/profile", destination: "/dashboard/settings/profile",
}, },
}; };
@@ -28,7 +28,7 @@ export async function getServerSideProps(
if (!user) { if (!user) {
return { return {
redirect: { redirect: {
permanent: true, permanent: false,
destination: "/", destination: "/",
}, },
}; };
@@ -36,7 +36,7 @@ export async function getServerSideProps(
if (user.role === "member") { if (user.role === "member") {
return { return {
redirect: { redirect: {
permanent: true, permanent: false,
destination: "/dashboard/settings/profile", destination: "/dashboard/settings/profile",
}, },
}; };
@@ -27,7 +27,7 @@ export async function getServerSideProps(
if (!user) { if (!user) {
return { return {
redirect: { redirect: {
permanent: true, permanent: false,
destination: "/", destination: "/",
}, },
}; };
@@ -54,7 +54,7 @@ export async function getServerSideProps(
if (!userPermissions?.sshKeys.read) { if (!userPermissions?.sshKeys.read) {
return { return {
redirect: { redirect: {
permanent: true, permanent: false,
destination: "/", destination: "/",
}, },
}; };
@@ -46,7 +46,7 @@ export async function getServerSideProps(ctx: GetServerSidePropsContext) {
if (!user) { if (!user) {
return { return {
redirect: { redirect: {
permanent: true, permanent: false,
destination: "/", destination: "/",
}, },
}; };
@@ -54,7 +54,7 @@ export async function getServerSideProps(ctx: GetServerSidePropsContext) {
if (user.role === "member") { if (user.role === "member") {
return { return {
redirect: { redirect: {
permanent: true, permanent: false,
destination: "/dashboard/settings/profile", destination: "/dashboard/settings/profile",
}, },
}; };
@@ -47,7 +47,7 @@ export async function getServerSideProps(
if (!userPermissions?.tag.read) { if (!userPermissions?.tag.read) {
return { return {
redirect: { redirect: {
permanent: true, permanent: false,
destination: "/", destination: "/",
}, },
}; };
@@ -39,7 +39,7 @@ export async function getServerSideProps(
if (!user) { if (!user) {
return { return {
redirect: { redirect: {
permanent: true, permanent: false,
destination: "/", destination: "/",
}, },
}; };
@@ -66,7 +66,7 @@ export async function getServerSideProps(
if (!userPermissions?.member.read) { if (!userPermissions?.member.read) {
return { return {
redirect: { redirect: {
permanent: true, permanent: false,
destination: "/", destination: "/",
}, },
}; };
@@ -46,7 +46,7 @@ export async function getServerSideProps(ctx: GetServerSidePropsContext) {
if (!user) { if (!user) {
return { return {
redirect: { redirect: {
permanent: true, permanent: false,
destination: "/", destination: "/",
}, },
}; };
@@ -54,7 +54,7 @@ export async function getServerSideProps(ctx: GetServerSidePropsContext) {
if (user.role !== "owner") { if (user.role !== "owner") {
return { return {
redirect: { redirect: {
permanent: true, permanent: false,
destination: "/dashboard/settings/profile", destination: "/dashboard/settings/profile",
}, },
}; };
+3 -3
View File
@@ -45,7 +45,7 @@ export async function getServerSideProps(
if (IS_CLOUD) { if (IS_CLOUD) {
return { return {
redirect: { redirect: {
permanent: true, permanent: false,
destination: "/dashboard/home", destination: "/dashboard/home",
}, },
}; };
@@ -54,7 +54,7 @@ export async function getServerSideProps(
if (!user) { if (!user) {
return { return {
redirect: { redirect: {
permanent: true, permanent: false,
destination: "/", destination: "/",
}, },
}; };
@@ -80,7 +80,7 @@ export async function getServerSideProps(
if (!userPermissions?.docker.read) { if (!userPermissions?.docker.read) {
return { return {
redirect: { redirect: {
permanent: true, permanent: false,
destination: "/", destination: "/",
}, },
}; };
+3 -3
View File
@@ -23,7 +23,7 @@ export async function getServerSideProps(
if (IS_CLOUD) { if (IS_CLOUD) {
return { return {
redirect: { redirect: {
permanent: true, permanent: false,
destination: "/dashboard/home", destination: "/dashboard/home",
}, },
}; };
@@ -32,7 +32,7 @@ export async function getServerSideProps(
if (!user) { if (!user) {
return { return {
redirect: { redirect: {
permanent: true, permanent: false,
destination: "/", destination: "/",
}, },
}; };
@@ -58,7 +58,7 @@ export async function getServerSideProps(
if (!userPermissions?.traefikFiles.read) { if (!userPermissions?.traefikFiles.read) {
return { return {
redirect: { redirect: {
permanent: true, permanent: false,
destination: "/", destination: "/",
}, },
}; };
+3 -3
View File
@@ -407,7 +407,7 @@ export async function getServerSideProps(context: GetServerSidePropsContext) {
if (user) { if (user) {
return { return {
redirect: { redirect: {
permanent: true, permanent: false,
destination: "/dashboard/home", destination: "/dashboard/home",
}, },
}; };
@@ -425,7 +425,7 @@ export async function getServerSideProps(context: GetServerSidePropsContext) {
if (!hasAdmin) { if (!hasAdmin) {
return { return {
redirect: { redirect: {
permanent: true, permanent: false,
destination: "/register", destination: "/register",
}, },
}; };
@@ -436,7 +436,7 @@ export async function getServerSideProps(context: GetServerSidePropsContext) {
if (user) { if (user) {
return { return {
redirect: { redirect: {
permanent: true, permanent: false,
destination: "/dashboard/home", destination: "/dashboard/home",
}, },
}; };
+4 -4
View File
@@ -333,7 +333,7 @@ export async function getServerSideProps(ctx: GetServerSidePropsContext) {
// if (IS_CLOUD) { // if (IS_CLOUD) {
// return { // return {
// redirect: { // redirect: {
// permanent: true, // permanent: false,
// destination: "/", // destination: "/",
// }, // },
// }; // };
@@ -342,7 +342,7 @@ export async function getServerSideProps(ctx: GetServerSidePropsContext) {
if (typeof token !== "string") { if (typeof token !== "string") {
return { return {
redirect: { redirect: {
permanent: true, permanent: false,
destination: "/", destination: "/",
}, },
}; };
@@ -365,7 +365,7 @@ export async function getServerSideProps(ctx: GetServerSidePropsContext) {
if (invitation.isExpired) { if (invitation.isExpired) {
return { return {
redirect: { redirect: {
permanent: true, permanent: false,
destination: "/", destination: "/",
}, },
}; };
@@ -382,7 +382,7 @@ export async function getServerSideProps(ctx: GetServerSidePropsContext) {
console.log("error", error); console.log("error", error);
return { return {
redirect: { redirect: {
permanent: true, permanent: false,
destination: "/", destination: "/",
}, },
}; };
+1 -1
View File
@@ -302,7 +302,7 @@ export async function getServerSideProps(context: GetServerSidePropsContext) {
if (user) { if (user) {
return { return {
redirect: { redirect: {
permanent: true, permanent: false,
destination: "/dashboard/home", destination: "/dashboard/home",
}, },
}; };
+2 -2
View File
@@ -190,7 +190,7 @@ export async function getServerSideProps(context: GetServerSidePropsContext) {
if (!IS_CLOUD) { if (!IS_CLOUD) {
return { return {
redirect: { redirect: {
permanent: true, permanent: false,
destination: "/", destination: "/",
}, },
}; };
@@ -200,7 +200,7 @@ export async function getServerSideProps(context: GetServerSidePropsContext) {
if (typeof token !== "string") { if (typeof token !== "string") {
return { return {
redirect: { redirect: {
permanent: true, permanent: false,
destination: "/", destination: "/",
}, },
}; };
+1 -1
View File
@@ -168,7 +168,7 @@ export async function getServerSideProps(_context: GetServerSidePropsContext) {
if (!IS_CLOUD) { if (!IS_CLOUD) {
return { return {
redirect: { redirect: {
permanent: true, permanent: false,
destination: "/", destination: "/",
}, },
}; };
+2 -2
View File
@@ -82,7 +82,7 @@ export async function getServerSideProps(context: GetServerSidePropsContext) {
if (!user) { if (!user) {
return { return {
redirect: { redirect: {
permanent: true, permanent: false,
destination: "/", destination: "/",
}, },
}; };
@@ -103,7 +103,7 @@ export async function getServerSideProps(context: GetServerSidePropsContext) {
if (!userPermissions?.api.read) { if (!userPermissions?.api.read) {
return { return {
redirect: { redirect: {
permanent: true, permanent: false,
destination: "/", destination: "/",
}, },
}; };