Giter Club home page Giter Club logo

Comments (6)

bondrogeen avatar bondrogeen commented on August 22, 2024

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.

nedoskiv avatar nedoskiv commented on August 22, 2024

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.

nedoskiv avatar nedoskiv commented on August 22, 2024

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.

bondrogeen avatar bondrogeen commented on August 22, 2024

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.

nedoskiv avatar nedoskiv commented on August 22, 2024

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.

bondrogeen avatar bondrogeen commented on August 22, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.