Finalny plan

This commit is contained in:
User Kill3rs4 2022-01-26 11:59:29 +01:00
parent 10662d2b44
commit b0853ed5c0
3 changed files with 35 additions and 1 deletions

17
.htaccess Normal file
View File

@ -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

2
app.js
View File

@ -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) { if (request.session.loggedin) {
response.send('Witaj, ' + request.session.username + '!'); response.send('Witaj, ' + request.session.username + '!');
} else { } else {

17
public/.htaccess Normal file
View File

@ -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