Skip to content

Commit

Permalink
fix: fixing #193 and #191
Browse files Browse the repository at this point in the history
  • Loading branch information
Raj Nandan Sharma authored and Raj Nandan Sharma committed Jan 15, 2025
1 parent 25ad42b commit dd3c26b
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 22 deletions.
2 changes: 1 addition & 1 deletion docs/quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ cp .env.example .env
npm run dev
```

Kener Development Server would be running at PORT 3000. Go to [http://localhost:3000](http://localhost:3000)
Kener Development Server would be running at PORT 3000. Go to [http://localhost:3000](http://localhost:3000) to see the Kener in action.

## Create a new User

Expand Down
4 changes: 2 additions & 2 deletions src/routes/(embed)/+layout.server.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ import {
export async function load({ params, route, url, cookies, request }) {
let isSetupComplete = await IsSetupComplete();
if (!isSetupComplete) {
throw redirect(302, base + "/setup");
throw redirect(302, base + "/manage/setup");
}

if (process.env.KENER_SECRET_KEY === undefined) {
throw redirect(302, base + "/setup");
throw redirect(302, base + "/manage/setup");
}

let isLoggedIn = await IsLoggedInSession(cookies);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export async function POST({ request, cookies }) {
if (!validatePassword(password)) {
let errorMessage =
"Password must contain at least one digit, one lowercase letter, one uppercase letter, and have a minimum length of 8 characters.";
throw redirect(302, base + "/setup?error=" + errorMessage);
throw redirect(302, base + "/manage/setup?error=" + errorMessage);
}
let user = {
email: email,
Expand Down
2 changes: 1 addition & 1 deletion src/routes/(manage)/manage/(app)/+layout.server.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export async function load({ params, route, url, cookies, request }) {
let siteData = await GetAllSiteData();
//check if user is authenticated using cookies
if (process.env.KENER_SECRET_KEY === undefined) {
throw redirect(302, base + "/setup");
throw redirect(302, base + "/manage/setup");
}
let tokenData = cookies.get("kener-user");

Expand Down
21 changes: 4 additions & 17 deletions vite.config.js
Original file line number Diff line number Diff line change
@@ -1,27 +1,14 @@
// @ts-nocheck
import dotenv from "dotenv";
import { sveltekit } from "@sveltejs/kit/vite";
import { defineConfig } from "vite";
import dotenv from "dotenv";

dotenv.config();

const PORT = Number(process.env.PORT) || 3000;
const base = process.env.KENER_BASE_PATH || "";
export default defineConfig({
logLevel: "silent",
plugins: [
sveltekit(),
{
name: "kener-startup-message",
configureServer(server) {
server.httpServer?.once("listening", () => {
const address = server.httpServer?.address();
const host = "localhost";
const port = address?.port;
console.log("\n🚀 Kener is running");
console.log(`⚙️ Manage Kener: http://${host}:${port}${base}/manage/app/site\n`);
});
}
}
],
plugins: [sveltekit()],
server: {
port: PORT,
watch: {
Expand Down

0 comments on commit dd3c26b

Please sign in to comment.