zyket 1.2.9 → 1.2.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zyket",
3
- "version": "1.2.9",
3
+ "version": "1.2.10",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"
@@ -37,6 +37,11 @@ module.exports = class AuthService extends Service {
37
37
  if (originsAdded) {
38
38
  this.#container.get('logger').info('Added TRUSTED_ORIGINS to .env file');
39
39
  }
40
+
41
+ const betterAuthUrlAdded = EnvManager.addEnvVariable(envPath, 'BETTER_AUTH_URL', 'http://localhost:3000');
42
+ if (betterAuthUrlAdded) {
43
+ this.#container.get('logger').info('Added BETTER_AUTH_URL to .env file');
44
+ }
40
45
  }
41
46
 
42
47
  #getDatabaseConnection() {
@@ -183,6 +188,7 @@ module.exports = class AuthService extends Service {
183
188
  expiresIn: 60 * 60 * 24 * 7,
184
189
  updateAge: 60 * 60 * 24
185
190
  },
191
+ baseURL: process.env.BETTER_AUTH_URL || 'http://localhost:3000',
186
192
  secret: process.env.AUTH_SECRET || 'your-secret-key-change-in-production',
187
193
  trustedOrigins: process.env.TRUSTED_ORIGINS?.split(',') || ['http://localhost:5173', 'http://localhost:6632']
188
194
  })
@@ -3,7 +3,7 @@ import { Route } from 'react-router-dom';
3
3
 
4
4
  export default function useLayout(routeList) {
5
5
 
6
- const routes = routesJSON.map((route, index) => {
6
+ const routes = routeList.map((route, index) => {
7
7
  const middlewares = route.middlewares ? [...route.middlewares].reverse() : [];
8
8
  let element = <route.component />;
9
9
  middlewares.forEach((middleware) => {
@@ -2,16 +2,16 @@ import AuthView from "../../views/auth";
2
2
  import AuthRegisterView from "../../views/auth/register";
3
3
  import NotLoggedMiddleware from "../../middlewares/NotLoggedMiddleware";
4
4
 
5
- module.exports = [
5
+ export default [
6
6
  {
7
7
  name: "Auth",
8
- path: "/auth",
8
+ path: "/",
9
9
  component: AuthView,
10
10
  middlewares: [NotLoggedMiddleware],
11
11
  },
12
12
  {
13
13
  name: "Auth Register",
14
- path: "/auth/register",
14
+ path: "/register",
15
15
  component: AuthRegisterView,
16
16
  middlewares: [NotLoggedMiddleware],
17
17
  }
@@ -1,5 +1,6 @@
1
1
  import { Navigate, Routes, Route, Link } from "react-router-dom";
2
2
  import useLayout from "../../hooks/useLayout";
3
+ import layoutRoutes from "./routes";
3
4
 
4
5
  export default function LandingLayout() {
5
6
  const { routes } = useLayout(layoutRoutes)
@@ -1,6 +1,6 @@
1
1
  import LandingView from "../../views/landing";
2
2
 
3
- module.exports = [
3
+ export default [
4
4
  {
5
5
  name: "Landing",
6
6
  path: "/",
@@ -1,11 +1,10 @@
1
1
  import { Navigate, Routes, Route, Link, useLocation } from "react-router-dom";
2
2
  import useLayout from "../../hooks/useLayout";
3
- import PanelDashboardView from "../../views/panel/dashboard";
4
3
  import layoutRoutes from "./routes";
5
4
 
6
5
  export default function PanelLayout() {
7
6
  const location = useLocation();
8
- const { routes } = useLayout();
7
+ const { routes } = useLayout(layoutRoutes);
9
8
 
10
9
  const navItems = [
11
10
  { name: "Dashboard", path: "/panel/dashboard", icon: "📊" },
@@ -1,10 +1,10 @@
1
1
  import PanelDashboardView from "../../views/panel/dashboard";
2
2
  import LoggedMiddleware from "../../middlewares/LoggedMiddleware";
3
3
 
4
- module.exports = [
4
+ export default [
5
5
  {
6
6
  name: "Panel Dashboard",
7
- path: "/panel/dashboard",
7
+ path: "/dashboard",
8
8
  component: PanelDashboardView,
9
9
  middlewares: [LoggedMiddleware],
10
10
  }