From b0853ed5c04bab6d4c3112052358b027a5e0d08b Mon Sep 17 00:00:00 2001 From: User Kill3rs4 Date: Wed, 26 Jan 2022 11:59:29 +0100 Subject: [PATCH] Finalny plan --- .htaccess | 17 +++++++++++++++++ app.js | 2 +- public/.htaccess | 17 +++++++++++++++++ 3 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 .htaccess create mode 100644 public/.htaccess diff --git a/.htaccess b/.htaccess new file mode 100644 index 0000000..1b186ec --- /dev/null +++ b/.htaccess @@ -0,0 +1,17 @@ +AuthBasicAuthoritative Off +AuthUserFile /dev/null +AuthMySQL On +AuthMySQL_Host localhost +AuthMySQL_User auth +AuthMySQL_Password haslo +AuthMySQL_DB authorize +AuthMySQL_Password_Table users +AuthMySQL_Username_Field login +AuthMySQL_Password_Field password +AuthMySQL_Empty_Passwords Off +AuthMySQL_Encryption_Types SHA1Sum +AuthMySQL_Authoritative On + +AuthType Basic +AuthName "Autoryzacja" +Require valid-user diff --git a/app.js b/app.js index 352260c..69440a0 100755 --- a/app.js +++ b/app.js @@ -50,7 +50,7 @@ app.post('/auth', function(request, response) { } }); -app.get('/home.html', function(request, response) { +app.get('/home', function(request, response) { if (request.session.loggedin) { response.send('Witaj, ' + request.session.username + '!'); } else { diff --git a/public/.htaccess b/public/.htaccess new file mode 100644 index 0000000..1b186ec --- /dev/null +++ b/public/.htaccess @@ -0,0 +1,17 @@ +AuthBasicAuthoritative Off +AuthUserFile /dev/null +AuthMySQL On +AuthMySQL_Host localhost +AuthMySQL_User auth +AuthMySQL_Password haslo +AuthMySQL_DB authorize +AuthMySQL_Password_Table users +AuthMySQL_Username_Field login +AuthMySQL_Password_Field password +AuthMySQL_Empty_Passwords Off +AuthMySQL_Encryption_Types SHA1Sum +AuthMySQL_Authoritative On + +AuthType Basic +AuthName "Autoryzacja" +Require valid-user