working on backend:
- started FileStore implementation - implemented placing cookies Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
This commit is contained in:
@@ -28,7 +28,7 @@ public class StaticPages extends PathHandler {
|
||||
System.out.printf("Loading %s for lagnuage %s…", path, lang);
|
||||
var response = loadTemplate(lang, path).orElseThrow(() -> new FileNotFoundException());
|
||||
|
||||
ex.getResponseHeaders().add("Content-Type", response.contentType);
|
||||
ex.getResponseHeaders().add(CONTENT_TYPE, response.contentType);
|
||||
ex.sendResponseHeaders(200, response.content.length);
|
||||
OutputStream os = ex.getResponseBody();
|
||||
os.write(response.content);
|
||||
|
||||
@@ -33,11 +33,11 @@ function tryLogin(){
|
||||
document.getElementById("error").innerHTML = "";
|
||||
var data = Object.fromEntries(new FormData(document.getElementById('login')));
|
||||
fetch(api+"/login",{
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'login-username': data.user,
|
||||
'login-password': data.pass, // TODO: send via body?
|
||||
Accept: 'application/json',
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
},
|
||||
body: JSON.stringify(data)
|
||||
}).then(handleLogin);
|
||||
}
|
||||
@@ -11,11 +11,11 @@
|
||||
<legend>User credentials</legend>
|
||||
<label>
|
||||
Username
|
||||
<input type="text" name="user" />
|
||||
<input type="text" name="username" />
|
||||
</label>
|
||||
<label>
|
||||
Password
|
||||
<input type="password" name="pass" />
|
||||
<input type="password" name="password" />
|
||||
</label>
|
||||
<button type="button" onClick="tryLogin()">Login</button>
|
||||
</fieldset>
|
||||
|
||||
Reference in New Issue
Block a user