Skip to content

Commit 3ab11c8

Browse files
Merge pull request #26 from ElementsProject/fix-token-expiry
Token expiry and other UI fixes
2 parents 129ae0a + 2aea113 commit 3ab11c8

File tree

20 files changed

+35
-28
lines changed

20 files changed

+35
-28
lines changed

.github/docs/Contributing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Development
44
* Change directory: cd cln-application
55
* Install dependencies: Assuming that nodejs (v14 & above) and npm are already installed, run `npm install`.
66
* Setup environment variables: Assuming that bitcoind and core-lightning are already running, adjust environment variables listed in `./env.sh` file and execute the script with `'. env.sh'` to setup required environment variables to connect to the node.
7-
* Setup Commando auth: Update `LIGHTNING_PUBKEY` and `LIGHTNING_RUNE` variables in `.commando` for successful backend authentication and connection via commando.
7+
* Setup Commando auth: Update `LIGHTNING_PUBKEY` and `LIGHTNING_RUNE` variables in `.commando` for successful backend authentication and connection via commando. Or run `entrypoint.sh` with correct lightningd path to do the same.
88
* Run backend server: Get backend server up by running `npm run backend:serve`.
99
* Watch backend server: Watch backend server for realtime changes with `npm run backend:watch`.
1010
* React frontend server: React development server is set to serve on port 4300. Run `npm run frontend:dev` script to get it working.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,6 @@
118118
119119
# Acknowledgements
120120
121-
- This app is inpired by the work done by [Umbrel lightning app](https://github.com/getumbrel/umbrel-lightning).
121+
- This app is inspired by the work done by [Umbrel lightning app](https://github.com/getumbrel/umbrel-lightning).
122122
123123
- The backend api connects with core lightning via [lnmessage](https://github.com/aaronbarnardsound/lnmessage).

apps/backend/dist/controllers/auth.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ class AuthController {
1212
const vpRes = verifyPassword(req.body.password);
1313
if (vpRes === true) {
1414
const token = jwt.sign({ userID: SECRET_KEY }, SECRET_KEY);
15-
res.cookie('token', token, { httpOnly: true, maxAge: 3600 * 24 * 7 });
15+
// Expire the token in a day
16+
res.cookie('token', token, { httpOnly: true, maxAge: 3600000 * 24 });
1617
return res.status(201).json({ isAuthenticated: true, isValidPassword: isValidPassword() });
1718
}
1819
else {

apps/backend/source/controllers/auth.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ class AuthController {
2020
const vpRes = verifyPassword(req.body.password);
2121
if (vpRes === true) {
2222
const token = jwt.sign({ userID: SECRET_KEY }, SECRET_KEY);
23-
res.cookie('token', token, { httpOnly: true, maxAge: 3600 * 24 * 7 });
23+
// Expire the token in a day
24+
res.cookie('token', token, { httpOnly: true, maxAge: 3600000 * 24 });
2425
return res.status(201).json({ isAuthenticated: true, isValidPassword: isValidPassword() });
2526
} else {
2627
const err = new AuthError(vpRes, vpRes, HttpStatusCode.UNAUTHORIZED, vpRes);
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
{
22
"files": {
3-
"main.css": "/static/css/main.179aa97d.css",
4-
"main.js": "/static/js/main.08092983.js",
3+
"main.css": "/static/css/main.ec053e02.css",
4+
"main.js": "/static/js/main.45257535.js",
55
"static/media/Inter-Bold.ttf": "/static/media/Inter-Bold.88fa7ae373b07b41ecce.ttf",
66
"static/media/Inter-SemiBold.ttf": "/static/media/Inter-SemiBold.4d56bb21f2399db8ad48.ttf",
77
"static/media/Inter-Medium.ttf": "/static/media/Inter-Medium.6dcbc9bed1ec438907ee.ttf",
88
"static/media/Inter-Thin.ttf": "/static/media/Inter-Thin.f341ca512063c66296d1.ttf",
99
"index.html": "/index.html",
10-
"main.179aa97d.css.map": "/static/css/main.179aa97d.css.map",
11-
"main.08092983.js.map": "/static/js/main.08092983.js.map"
10+
"main.ec053e02.css.map": "/static/css/main.ec053e02.css.map",
11+
"main.45257535.js.map": "/static/js/main.45257535.js.map"
1212
},
1313
"entrypoints": [
14-
"static/css/main.179aa97d.css",
15-
"static/js/main.08092983.js"
14+
"static/css/main.ec053e02.css",
15+
"static/js/main.45257535.js"
1616
]
1717
}

apps/frontend/build/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="./images/cln-favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="color-scheme" content="light dark"><meta name="description" content="Core lightning application"/><link rel="apple-touch-icon" href="./images/cln-logo-dark.png"/><title>Core Lightning</title><script defer="defer" src="/static/js/main.08092983.js"></script><link href="/static/css/main.179aa97d.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
1+
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="./images/cln-favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="color-scheme" content="light dark"><meta name="description" content="Core lightning application"/><link rel="apple-touch-icon" href="./images/cln-logo-dark.png"/><title>Core Lightning</title><script defer="defer" src="/static/js/main.45257535.js"></script><link href="/static/css/main.ec053e02.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>

apps/frontend/build/static/css/main.179aa97d.css.map

Lines changed: 0 additions & 1 deletion
This file was deleted.

apps/frontend/build/static/css/main.179aa97d.css renamed to apps/frontend/build/static/css/main.ec053e02.css

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/frontend/build/static/css/main.ec053e02.css.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/frontend/build/static/js/main.08092983.js.map

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)