Ready for 1.1.3-rc.3 release.

This commit is contained in:
charlesgauthereau
2025-11-04 09:20:24 +01:00
parent a435a92d41
commit c4ebc876bf
4 changed files with 20 additions and 29 deletions
+1 -1
View File
@@ -7,7 +7,7 @@ services:
# context: . # context: .
# dockerfile: docker/dockerfile/Dockerfile # dockerfile: docker/dockerfile/Dockerfile
# target: prod # target: prod
image: solucetechnologies/portabase:1.1.3-rc.2 image: solucetechnologies/portabase:1.1.3-rc.3
ports: ports:
- '8887:80' - '8887:80'
env_file: env_file:
+2 -8
View File
@@ -3,7 +3,6 @@ import { loggingMiddleware } from "@/middleware/loggingMiddleware";
import {errorHandler} from "@/middleware/errorHandler"; import {errorHandler} from "@/middleware/errorHandler";
import {auth} from "@/lib/auth/auth"; import {auth} from "@/lib/auth/auth";
import {headers} from "next/headers"; import {headers} from "next/headers";
import { signOut } from "@/lib/auth/auth-client";
export async function proxy(request: NextRequest) { export async function proxy(request: NextRequest) {
const url = request.nextUrl.clone(); const url = request.nextUrl.clone();
@@ -13,25 +12,20 @@ export async function proxy(request: NextRequest) {
const session = await auth.api.getSession({ const session = await auth.api.getSession({
headers: await headers(), headers: await headers(),
}); });
if (!session) { if (!session) {
return NextResponse.redirect(new URL(`/login?redirect=${redirectUrl}`, request.url)); return NextResponse.redirect(new URL(`/login?redirect=${redirectUrl}`, request.url));
} }
if (session.user.banned) { if (session.user.banned) {
signOut(); await auth.api.signOut({headers: await headers()});
return NextResponse.redirect(new URL("/login?error=banned", request.url)); return NextResponse.redirect(new URL("/login?error=banned", request.url));
} }
if (session.user.role === "pending") { if (session.user.role === "pending") {
signOut(); await auth.api.signOut({headers: await headers()});
return NextResponse.redirect(new URL(`/login?error=pending?redirect=${redirectUrl}`, request.url)); return NextResponse.redirect(new URL(`/login?error=pending?redirect=${redirectUrl}`, request.url));
} }
if (url.pathname === "/dashboard") { if (url.pathname === "/dashboard") {
return NextResponse.redirect(new URL(`/dashboard/home`, request.url)); return NextResponse.redirect(new URL(`/dashboard/home`, request.url));
} }
return NextResponse.next(); return NextResponse.next();
} }
+3 -6
View File
@@ -4,14 +4,11 @@ import {createAuthClient} from "better-auth/react";
import {adminClient, inferAdditionalFields, organizationClient} from "better-auth/client/plugins"; import {adminClient, inferAdditionalFields, organizationClient} from "better-auth/client/plugins";
import {ac, user, admin as adminRole, pending, superadmin, orgAdmin, orgMember, orgOwner} from "./permissions"; import {ac, user, admin as adminRole, pending, superadmin, orgAdmin, orgMember, orgOwner} from "./permissions";
import {auth} from "@/lib/auth/auth"; import {auth} from "@/lib/auth/auth";
import {getServerUrl} from "@/utils/get-server-url";
const baseURL = const res = await fetch(`${getServerUrl()}/api/config`);
typeof window === "undefined"
? process.env.PROJECT_URL // server side
: "";
const res = await fetch(`${baseURL}/api/config`);
const {PROJECT_URL} = await res.json(); const {PROJECT_URL} = await res.json();
console.log(PROJECT_URL);
export const authClient = createAuthClient({ export const authClient = createAuthClient({
baseURL: PROJECT_URL, baseURL: PROJECT_URL,
+2 -2
View File
@@ -5,7 +5,7 @@ export const getServerUrl = () => {
return window.location.origin; return window.location.origin;
} }
if (env.NODE_ENV === "development") { if (env.NODE_ENV === "development") {
return `${env.NEXT_PUBLIC_PROJECT_URL}`; return `${env.PROJECT_URL}`;
} }
return `${env.NEXT_PUBLIC_PROJECT_URL}`; return `${env.PROJECT_URL}`;
}; };