fix logout by setting the api route as logout target

This commit is contained in:
dswbx
2025-06-07 08:48:28 +02:00
parent 3fbea8ace7
commit a5b59c004e
2 changed files with 4 additions and 3 deletions

View File

@@ -50,11 +50,11 @@ export class AdminController extends Controller {
}
get basepath() {
return this.options.basepath ?? "/";
return this.options.adminBasepath ?? "/";
}
private withBasePath(route: string = "") {
return (this.basepath + route).replace(/(?<!:)\/+/g, "/");
return (this.options.basepath + route).replace(/(?<!:)\/+/g, "/");
}
private withAdminBasePath(route: string = "") {
@@ -80,7 +80,7 @@ export class AdminController extends Controller {
loggedOut: configs.auth.cookie.pathLoggedOut ?? this.withAdminBasePath("/"),
login: this.withAdminBasePath("/auth/login"),
register: this.withAdminBasePath("/auth/register"),
logout: this.withAdminBasePath("/auth/logout"),
logout: "/api/auth/logout",
};
const paths = ["/", "/data/*", "/auth/*", "/media/*", "/flows/*", "/settings/*"];