Skip to content

Commit 921fa6f

Browse files
fix: build with csrf context, also /links
1 parent a602d04 commit 921fa6f

File tree

7 files changed

+14
-10
lines changed

7 files changed

+14
-10
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,4 +57,4 @@ jspm_packages/
5757
linklite/public/frontend
5858
linklite/public/node_modules
5959
node_modules/
60-
linklite/www/frontend.html
60+
linklite/www/links.html

frontend/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@
66
"scripts": {
77
"dev": "vite",
88
"build": "vite build --base=/assets/linklite/frontend/ && yarn copy-html-entry",
9-
"preview": "vite preview",
10-
"copy-html-entry": "cp ../linklite/public/frontend/index.html ../linklite/www/frontend.html"
9+
"copy-html-entry": "cp ../linklite/public/frontend/index.html ../linklite/www/links.html"
1110
},
1211
"dependencies": {
1312
"feather-icons": "^4.29.2",

frontend/src/pages/Home.vue

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,6 @@
3535
:options="{
3636
showTooltip: false,
3737
selectable: false,
38-
// onRowClick: (row) => {
39-
// editDialogShown = true
40-
// Object.assign(newLink, row)
41-
// },
4238
emptyState: {
4339
title: 'No links found',
4440
description: 'Create a new short link to get started',

frontend/src/router.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const routes = [
1616
]
1717

1818
const router = createRouter({
19-
history: createWebHistory('/frontend'),
19+
history: createWebHistory('/links'),
2020
routes,
2121
})
2222

frontend/vite.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export default defineConfig({
1111
jinjaBootData: true,
1212
lucideIcons: true,
1313
buildConfig: {
14-
indexHtmlPath: "../linklite/www/frontend.html",
14+
indexHtmlPath: "../linklite/www/links.html",
1515
emptyOutDir: true,
1616
sourcemap: true,
1717
},

linklite/hooks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"name": "linklite",
3434
"logo": "/assets/linklite/logo.png",
3535
"title": "Link Lite",
36-
"route": "/frontend",
36+
"route": "/links",
3737
"has_permission": "linklite.linklite.utils.permissions.has_app_permission"
3838
}
3939
]

linklite/www/links.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import frappe
2+
3+
4+
def get_context(context):
5+
csrf_token = frappe.sessions.get_csrf_token()
6+
frappe.db.commit()
7+
context.boot = frappe._dict()
8+
context.boot.csrf_token = csrf_token
9+
return context

0 commit comments

Comments
 (0)