Comments (6)
Using simple forms, there will be restrictions. since sending the form requires a reload of the page.
And so I recommend using JS to send forms or manage ESP.
But sending simple forms is possible.
https://github.com/bondrogeen/web-server/tree/master/example/simple_form
What do you want to send in the form?
Maybe I'll tell you how it's easier to do with JavaScript.
from dot.
Thank you, I will check it out myself, but as long as I examined your HTML/JAVASCRIPT/LUA code (not simple_form)
I got to conclusion that authentication is not server based, it is most likely javascript based and probably can be bypassed by someone with little more programing skills in java than mine.
PS. found in your code, it checks for specific cookie, if not correct, redirect to login.html. It is server based after all :) but can you consider implementing HTTP basic auth?
from dot.
and another how to access request variable inside html file using lua code:
<!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"><title>Settings page</title></head><body><pre>
<?lua return req.init ?>
</pre>
tried that, but it is not working
from dot.
Reconciliation occurs on the server, the key changes every time when ESP is rebooted. JS sends key verification requests.
Http basic authentication is also not secure.
You can hack everything. )))
I decided to use Form-based authentication, as there are more possibilities than Http basic authentication.
ESP is limited in resources, and have to sacrifice something.
bug in authentication know, I'll fix it later.
from dot.
yes it is very limited, I hope your server consume less memory than currently used one by me. But what about my second questions about how to access req variable array into lua code inside HTML file.
from dot.
req - must be a global variable
or use the module to access a variable with FS
Everything depends on the specific task.
https://codedevice.ru/archives/604 (Russian)
yet
https://github.com/bondrogeen/NodeMCU-modules
from dot.
Related Issues (14)
- problem when wifi password is only numbers HOT 3
- possible memory issue HOT 6
- Memory leak HOT 7
- feature request: file uploading HOT 1
- Adding timer to fix a memory leak
- Javascript fix HOT 1
- not working on latest chrome HOT 1
- some code not work on master branch HOT 10
- web_get.lua HOT 2
- Safari problem HOT 10
- XMLHttpRequest problem on some browsers
- Problem with init_settings.lua HOT 3
- Приветственная страница и админка по другому пути HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dot.